Skip to main content
Glama

search_repositories

Enables efficient search of GitHub repositories by query and language, streamlining access to codebases on the Multi-MCPs server.

Instructions

Search GitHub repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNo
queryYes

Implementation Reference

  • The main handler function for the 'search_repositories' tool. It validates the input arguments, checks for GitHub token configuration, and delegates to the GitHub client's searchRepositories method.
    async search_repositories(args: Record<string, unknown>) { if (!cfg.githubToken) throw new Error("GITHUB_TOKEN is not configured"); const query = String(args.query || ""); const language = args.language ? String(args.language) : undefined; if (!query) throw new Error("query is required"); return client.searchRepositories(query, language); },
  • Input schema defining the expected parameters for the 'search_repositories' tool: query (required string) and optional language (string).
    inputSchema: { type: "object", properties: { query: { type: "string" }, language: { type: "string" }, }, required: ["query"], },
  • Registration entry for the 'search_repositories' tool within the GitHub tools array returned by registerGitHub().
    { name: "search_repositories", description: "Search GitHub repositories", inputSchema: { type: "object", properties: { query: { type: "string" }, language: { type: "string" }, }, required: ["query"], }, },
  • Helper method on GitHubClient class that constructs the search query and makes the API request to GitHub's /search/repositories endpoint.
    searchRepositories(query: string, language?: string) { const q = language ? `${query} language:${language}` : query; return this.request("/search/repositories", { query: { q } }); }

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/TaylorChen/muti-mcps'

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