searchIssues
Search GitHub issues and discussions in your Obsidian vault repository to track tasks, manage projects, and enhance collaborative knowledge work using structured queries.
Instructions
Search for issues and discussions in your Obsidian vault repository (my-organization/obsidian-vault). Great for tracking tasks, project management, and collaborative knowledge work.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (uses GitHub Issue Search syntax) |
Implementation Reference
- src/github/client.ts:612-633 (handler)Handler function that searches for issues in the GitHub repository using the Octokit client. It appends 'is:issue' to the query and formats the results as a markdown list.async ({ query }) => { const repoQualifier = `repo:${this.config.owner}/${this.config.repo}`; const qualifiedQuery = `${query} is:issue ${repoQualifier}`; const searchResults = await this.handleRequest(async () => { return this.octokit.search.issuesAndPullRequests({ q: qualifiedQuery, }); }); // Format results as a markdown list const formattedResults = searchResults.items .map((item) => `- #${item.number} ${item.title} (${item.html_url})`) .join("\n"); return { // Return formatted text instead of raw JSON string content: [ { type: "text" as const, text: `Found ${searchResults.total_count} issues:\n${formattedResults}`, }, ], }; }
- src/github/client.ts:602-605 (schema)Zod schema defining the input parameter 'query' for the searchIssues tool.query: z .string() .describe("Search query (uses GitHub Issue Search syntax)"), },
- src/github/client.ts:598-634 (registration)Registration of the searchIssues tool using server.tool, including name, description, schema, hints, and inline handler.server.tool( "searchIssues", `Search for issues and discussions in your Obsidian vault repository (${this.config.owner}/${this.config.repo}). Great for tracking tasks, project management, and collaborative knowledge work.`, { query: z .string() .describe("Search query (uses GitHub Issue Search syntax)"), }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, async ({ query }) => { const repoQualifier = `repo:${this.config.owner}/${this.config.repo}`; const qualifiedQuery = `${query} is:issue ${repoQualifier}`; const searchResults = await this.handleRequest(async () => { return this.octokit.search.issuesAndPullRequests({ q: qualifiedQuery, }); }); // Format results as a markdown list const formattedResults = searchResults.items .map((item) => `- #${item.number} ${item.title} (${item.html_url})`) .join("\n"); return { // Return formatted text instead of raw JSON string content: [ { type: "text" as const, text: `Found ${searchResults.total_count} issues:\n${formattedResults}`, }, ], }; } );