estimate_capability
Get cost estimates for API capabilities before execution to plan budgets and optimize workflows in AI agent development.
Instructions
Get cost estimate for executing a capability without actually executing it. Use before expensive operations or when building cost-aware workflows.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| capability_id | Yes | Capability to estimate cost for (e.g. 'email.send') | |
| provider | No | Optional: specific provider. If omitted, estimates for the auto-selected provider. | |
| credential_mode | No | Credential mode: byo (default), rhumb_managed, or agent_vault |
Implementation Reference
- packages/mcp/src/tools/estimate.ts:12-22 (handler)The tool handler function for `estimate_capability`. It takes the validated input and calls the Rhumb API client's `estimateCapability` method.
export async function handleEstimateCapability( input: EstimateCapabilityInput, client: RhumbApiClient ): Promise<EstimateCapabilityOutput> { const result = await client.estimateCapability(input.capability_id, { provider: input.provider, credentialMode: input.credential_mode }); return result; } - packages/mcp/src/types.ts:248-256 (schema)The JSON schema definition for the `estimate_capability` tool input.
export const EstimateCapabilityInputSchema = { type: "object" as const, properties: { capability_id: { type: "string" as const, description: "Capability to estimate (e.g. 'email.send'). Call this BEFORE execute_capability to know the cost in advance." }, provider: { type: "string" as const, description: "Specific provider slug. Omit to estimate for the auto-selected provider based on your routing strategy." }, credential_mode: { type: "string" as const, description: "'auto' (default: use Rhumb Resolve when an active managed config exists, otherwise fall back to byo), 'rhumb_managed', 'byo' (BYOK), or 'agent_vault'. Affects pricing — rhumb_managed includes a 20% markup." } }, required: ["capability_id"] as const }; - packages/mcp/src/server.ts:176-186 (registration)Registration of the `estimate_capability` tool in the MCP server, including input definition and handler invocation. (Note: excerpt is reconstructed based on the pattern found in file).
// -- estimate_capability ----------------------------------------------- server.tool( "estimate_capability", "Get the cost of a Capability call WITHOUT making the call. Returns cost in USD, circuit health, and endpoint pattern. Default credential mode is auto: Rhumb uses Rhumb Resolve when an active managed config exists, otherwise falls back to byo (BYOK). Always call this before execute_capability for cost-sensitive workflows — no charge for estimates.", { capability_id: z.string().describe(EstimateCapabilityInputSchema.properties.capability_id.description), provider: z.string().optional().describe(EstimateCapabilityInputSchema.properties.provider.description), credential_mode: z.string().optional().describe(EstimateCapabilityInputSchema.properties.credential_mode.description) }, async ({ capability_id, provider, credential_mode }) => { const result = await handleEstimateCapability(