Skip to main content
Glama

search_public_apis

Find free public APIs matching your query using semantic search across an extensive catalog of API names and descriptions.

Instructions

Search for free public APIs that match the input query string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Implementation Reference

  • The handler function for the 'search_public_apis' tool. It embeds the query, searches the index, loads catalog items, and returns matching SearchResults.
    @mcp.tool def search_public_apis(query: str, limit: int = 5) -> list[SearchResult]: """Search for free public APIs that match the input query string.""" idx = ensure_index() qvec, _ = embed_query(query, model_id=idx.model_id) top = idx.search(qvec, top_k=max(1, min(50, int(limit)))) # limit to 50 items, by_id = load_catalog_indexed() results: list[SearchResult] = [] for api_id, score in top: item = by_id.get(api_id) if not item: continue results.append( SearchResult( id=item.id, name=item.api, score=float(score), snippet=item.description, ) ) return results
  • Pydantic model defining the output schema for the search_public_apis tool.
    class SearchResult(BaseModel): id: str name: str score: float snippet: str
  • Invocation of register_tools(mcp) which registers the search_public_apis tool via its @mcp.tool decorator.
    register_tools(mcp)
Install Server

Other Tools

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/zazencodes/public-apis-mcp'

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