resolve_capability
Find ranked API providers for specific capabilities with health-aware recommendations, cost analysis, and fallback options to ensure reliable execution.
Instructions
Resolve a capability to ranked providers with health-aware recommendations, costs, and fallback chains. The core agent decision: 'I need email.send — what should I use?'
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| capability | Yes | Capability ID to resolve (e.g. 'email.send', 'payment.charge') |
Implementation Reference
- packages/mcp/src/tools/resolve.ts:11-36 (handler)The handler function `handleResolveCapability` for the `resolve_capability` tool, which calls the `RhumbApiClient` to resolve a capability.
export async function handleResolveCapability( input: ResolveCapabilityInput, client: RhumbApiClient ): Promise<ResolveCapabilityOutput> { try { const result = await client.resolveCapability(input.capability); if (!result) { return { capability: input.capability, providers: [], fallbackChain: [], relatedBundles: [] }; } return result; } catch { return { capability: input.capability, providers: [], fallbackChain: [], relatedBundles: [] }; } } - packages/mcp/src/server.ts:136-148 (registration)Registration of the `resolve_capability` tool in the MCP server instance, mapping it to `handleResolveCapability`.
server.tool( "resolve_capability", "Given a Capability ID, returns ranked providers with health status, cost per call, auth methods, endpoint patterns, and fallback chains. This is the core routing decision: 'I need email.send — which provider should I use?' Call this before execute_capability to understand your options.", { capability: z.string().describe(ResolveCapabilityInputSchema.properties.capability.description) }, async ({ capability }) => { const result = await handleResolveCapability({ capability }, client); return { content: [{ type: "text" as const, text: JSON.stringify(result) }] }; } ); - packages/mcp/src/types.ts:154-177 (schema)Schema definitions for `resolve_capability` tool inputs and outputs.
export const ResolveCapabilityInputSchema = { type: "object" as const, properties: { capability: { type: "string" as const, description: "Capability ID from discover_capabilities (e.g. 'email.send', 'payment.charge'). Returns ranked providers with costs, health status, and fallback chains." } }, required: ["capability"] as const }; export type ResolveCapabilityInput = { capability: string; }; export type CapabilityProvider = { serviceSlug: string; serviceName: string; anScore: number | null; costPerCall: number | null; freeTierCalls: number | null; authMethod: string; endpointPattern: string; recommendation: string; recommendationReason: string; };