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
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | ||
| query | Yes |
Implementation Reference
- src/apis/github/github.ts:92-98 (handler)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); },
- src/apis/github/github.ts:43-50 (schema)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"], },
- src/apis/github/github.ts:40-51 (registration)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"], }, },
- src/apis/github/github.ts:13-16 (helper)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 } }); }