Skip to main content
Glama

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
NameRequiredDescriptionDefault
capabilityYesCapability ID to resolve (e.g. 'email.send', 'payment.charge')

Implementation Reference

  • 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: []
        };
      }
    }
  • 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) }]
        };
      }
    );
  • 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;
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/supertrained/rhumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server