Skip to main content
Glama

find_tools

Search for AI agent tools using semantic queries and rank results by AN Score to discover relevant APIs for integration.

Instructions

Semantic search for agent tools, ranked by AN Score

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSemantic search query for tool discovery
limitNoMax results to return (default 10)

Implementation Reference

  • The handler function `handleFindServices` performs a semantic search for services using the Rhumb API and ranks them by aggregate score.
    export async function handleFindServices(
      input: FindServiceInput,
      client: RhumbApiClient
    ): Promise<FindServiceOutput> {
      const limit = Math.min(Math.max(input.limit ?? DEFAULT_LIMIT, 1), MAX_LIMIT);
    
      try {
        const services = await client.searchServices(input.query);
    
        // Sort by aggregateScore descending — nulls sink to bottom
        const sorted = [...services].sort((a, b) => {
          if (a.aggregateScore === null && b.aggregateScore === null) return 0;
          if (a.aggregateScore === null) return 1;
          if (b.aggregateScore === null) return -1;
          return b.aggregateScore - a.aggregateScore;
        });
    
        return {
          services: sorted.slice(0, limit).map((s) => ({
            name: s.name,
            slug: s.slug,
            aggregateScore: s.aggregateScore,
            executionScore: s.executionScore,
            accessScore: s.accessScore,
            explanation: s.explanation
          }))
        };
      } catch {
        // Resilient fallback: return empty array on any error
        return { services: [] };
      }
    }
  • Registration of the 'find_services' tool in the MCP server, which calls `handleFindServices`. Note that while the user asked for 'find_tools', the implementation and registration are for 'find_services'.
    // -- find_services -----------------------------------------------------
    server.tool(
      "find_services",
      "Search indexed Services by what you need them to do. Returns ranked Services with AN Scores. Use this when you know the problem but not which Service to call. For Capability-level search (e.g. 'email.send'), use discover_capabilities instead.",
      {
        query: z.string().describe(FindServiceInputSchema.properties.query.description),
        limit: z.number().min(1).max(50).optional().describe(FindServiceInputSchema.properties.limit.description)
      },
      async ({ query, limit }) => {
        const result = await handleFindServices({ query, limit }, client);
        return {
          content: [{ type: "text" as const, text: JSON.stringify(result) }]
        };
      }
    );

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