Ask Ostra Pro
The ostra_pro_chat tool on the Ostra MCP server — arguments, result, errors and examples.
https://ostra.testrelic.ai/mcp · ostra_pro_chatAsks Ostra Pro, TestRelic’s testing model, a question: write or fix a test, analyse a failure or log, read a screenshot.
Send either prompt (with optional system and images) or a full messages array, not both. Long answers can stream progress: see MCP overview.
- Title
- Ostra Pro: ask the testing model
- Access
- Full-access key. Read-only keys can list the tool but not call it.
- Cost
- Per token, the same as chat completions.
- Hints
- readOnlyHint: true · destructiveHint: false · idempotentHint: false · openWorldHint: false
- Over REST
- POST /api/v1/chat/completions
Once the Ostra MCP server is connected, your agent calls the tool with these arguments.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}curl https://ostra.testrelic.ai/mcp \
-H "Authorization: Bearer $OSTRA_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2025-06-18' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}'import os
import requests
response = requests.post(
"https://ostra.testrelic.ai/mcp",
headers={
"Authorization": f"Bearer {os.environ['OSTRA_API_KEY']}",
"Accept": "application/json, text/event-stream",
"MCP-Protocol-Version": "2025-06-18",
},
json={
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1",
},
},
},
timeout=60,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://ostra.testrelic.ai/mcp', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.OSTRA_API_KEY}`,
'Content-Type': 'application/json',
Accept: 'application/json, text/event-stream',
'MCP-Protocol-Version': '2025-06-18',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'ostra_pro_chat',
arguments: {
prompt: 'This Playwright test times out on CI but passes locally. Why, and how do I fix it?',
reasoning_effort: 'low',
max_tokens: 2048,
session: 'checkout-fix-1',
},
},
}),
});
if (!response.ok) {
throw new Error(`Ostra ${response.status}: ${await response.text()}`);
}
console.log(await response.json());package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}`)
req, err := http.NewRequest("POST", "https://ostra.testrelic.ai/mcp", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("OSTRA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json, text/event-stream")
req.Header.Set("MCP-Protocol-Version", "2025-06-18")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(out))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class OstraExample {
public static void main(String[] args) throws Exception {
String body = """
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://ostra.testrelic.ai/mcp"))
.header("Authorization", "Bearer " + System.getenv("OSTRA_API_KEY"))
.header("Content-Type", "application/json")
.header("Accept", "application/json, text/event-stream")
.header("MCP-Protocol-Version", "2025-06-18")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OSTRA_API_KEY"));
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream"));
client.DefaultRequestHeaders.Add("MCP-Protocol-Version", "2025-06-18");
using var request = new HttpRequestMessage(HttpMethod.Post, "https://ostra.testrelic.ai/mcp");
request.Content = new StringContent(
"""
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}
""",
Encoding.UTF8,
"application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());require "net/http"
require "uri"
uri = URI("https://ostra.testrelic.ai/mcp")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("OSTRA_API_KEY")}"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json, text/event-stream"
request["MCP-Protocol-Version"] = "2025-06-18"
request.body = <<~'JSON'
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.code
puts response.body<?php
$ch = curl_init("https://ostra.testrelic.ai/mcp");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("OSTRA_API_KEY"),
"Content-Type: application/json",
"Accept: application/json, text/event-stream",
"MCP-Protocol-Version: 2025-06-18",
],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ostra_pro_chat",
"arguments": {
"prompt": "This Playwright test times out on CI but passes locally. Why, and how do I fix it?",
"reasoning_effort": "low",
"max_tokens": 2048,
"session": "checkout-fix-1"
}
}
}
JSON,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), PHP_EOL;
echo $response, PHP_EOL;Headers
- mcp-protocol-version
- 2025-06-18
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "CI machines are slower and run tests in parallel, so the coupon button renders after your 30 s timeout. Wait for the state you need instead of a fixed time: `await expect(page.getByRole('button', { name: 'Apply coupon' })).toBeEnabled()` before clicking, and stop sharing the cart between tests so parallel workers don’t race."
}
],
"structuredContent": {
"model": "ostra-pro",
"version": "1.0",
"content": "CI machines are slower and run tests in parallel, so the coupon button renders after your 30 s timeout. Wait for the state you need instead of a fixed time: `await expect(page.getByRole('button', { name: 'Apply coupon' })).toBeEnabled()` before clicking, and stop sharing the cart between tests so parallel workers don’t race.",
"finish_reason": "stop",
"usage": {
"input_tokens": 61,
"cached_input_tokens": 0,
"output_tokens": 170
},
"cost_usd": "0.00079894",
"balance_usd": "24.99920106",
"request_id": "req_01JDXKB3C4D5E6F7G8H9J0K1L2"
},
"isError": false
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "Your balance ($0.00) does not cover this request ($0.0000005). Top up in the TestRelic Console."
}
],
"structuredContent": {
"error": {
"type": "insufficient_balance",
"message": "Your balance ($0.00) does not cover this request ($0.0000005). Top up in the TestRelic Console.",
"balance_usd": "0.00",
"cost_usd": "0.0000005"
}
},
"isError": true
}
}Arguments
promptstringThe question or task. Use this or
messages.systemstringSystem prompt to go with
prompt.imagesarray of stringsImage URLs to go with
prompt:https://…ordata:image/…;base64,….0–8 itemsmessagesarray of objectsA full OpenAI-style conversation instead of
prompt/system/images.max_tokensintegerMost output tokens, reasoning included.
1 to 32,768default 8192reasoning_effortstringHow long to think;
noneturns thinking off.One ofnonelowmediumxhighdefault "xhigh"temperaturenumberSampling temperature.
0 to 2sessionstringOptional conversation id, one per conversation or agent run (like
x-ostra-session). Calls with the same value go to the same model replica when possible (best effort), so follow-up calls more often bill a repeated prompt prefix as cached input.pattern ^[\w.:-]{1,128}$
Result
content[0].text holds the answer as text; structuredContent holds it as JSON:
modelstringostra-pro.versionstring1.0.contentstringThe answer (also the tool result’s text content).
reasoning_contentstringThe reasoning, when thinking was on.
finish_reasonstringstop,lengthortool_calls.usageobjectinput_tokens,cached_input_tokens,output_tokens.cost_usdstringWhat the call cost.
balance_usdstringBalance after the call.
request_idstringRequest id.
Errors
Billing, validation, rate-limit and permission problems come back as a normal result with isError: true and structuredContent.error (type, message), the same types as the REST errors. Authentication failures are HTTP 401/403 before any JSON-RPC.