estimate_cost
Estimate the USD cost of an MCP tool call BEFORE invoking it. Returns median + P90 + average cost from the org's last-30-day history for this exact (server, tool) combo. Use this to make spend-aware decisions in your agent — e.g. confirm with the user before invoking tools where the estimate exceeds your budget. Returns isUnknown=true with zero cost when no baseline exists yet.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"serverName": "<serverName>",
"toolName": "<toolName>"
},
"name": "estimate_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Optional model identifier. Falls back to the historical median across all models when omitted. | |
| toolName | Yes | Tool name within the server, e.g. "browser_navigate". | |
| serverName | Yes | MCP server name, e.g. "playwright" or "github". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| toolName | Yes | ||
| isUnknown | Yes | ||
| avgCostUsd | No | ||
| p90CostUsd | No | 90th percentile cost — worst-case reasonable estimate. | |
| sampleSize | Yes | ||
| serverName | Yes | ||
| successRate | No | 0-1, fraction of historical calls that succeeded. | |
| avgLatencyMs | No | ||
| avgInputTokens | No | ||
| avgOutputTokens | No | ||
| estimatedCostUsd | Yes | Median cost from sample. |