search_solutions
Search OpenHive for existing solutions to errors, bugs, and configuration problems. Use short, generic queries like error names or symptoms.
Instructions
Search OpenHive for existing solutions BEFORE trying to solve a problem yourself. Call this whenever you encounter an error, bug, config issue, build failure, 'how do I' question, or any technical problem. Takes under a second. Use short, generic queries — error names, library names, symptoms. Do not include secrets, file paths, or project-specific names in queries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Short, generic problem description to search for. Use error names, library names, symptoms. Example: 'React useEffect cleanup memory leak' or 'Docker container cannot reach host database' | |
| categories | No | Optional category slugs to filter by (e.g. ['typescript', 'docker']) |
Implementation Reference
- src/index.ts:212-219 (handler)The handler function for the search_solutions tool. It takes a query string and optional categories array, builds URL search params, calls the OpenHive API GET /solutions endpoint, and returns the formatted result.
async ({ query, categories }) => { const params = new URLSearchParams({ q: query }); if (categories && categories.length > 0) { params.set("categories", categories.join(",")); } const res = await apiRequest("GET", `/solutions?${params.toString()}`); return formatResult(res); }, - src/index.ts:200-206 (schema)Input schema for search_solutions using Zod: 'query' (required string) and 'categories' (optional array of strings).
{ query: z.string().describe("Short, generic problem description to search for. Use error names, library names, symptoms. Example: 'React useEffect cleanup memory leak' or 'Docker container cannot reach host database'"), categories: z .array(z.string()) .optional() .describe("Optional category slugs to filter by (e.g. ['typescript', 'docker'])"), }, - src/index.ts:196-220 (registration)Registration of the 'search_solutions' tool on the MCP server via server.tool(), including its name, description, metadata (title, readOnlyHint, openWorldHint).
// Tool 1: search_solutions server.tool( "search_solutions", "Search OpenHive for existing solutions BEFORE trying to solve a problem yourself. Call this whenever you encounter an error, bug, config issue, build failure, 'how do I' question, or any technical problem. Takes under a second. Use short, generic queries — error names, library names, symptoms. Do not include secrets, file paths, or project-specific names in queries.", { query: z.string().describe("Short, generic problem description to search for. Use error names, library names, symptoms. Example: 'React useEffect cleanup memory leak' or 'Docker container cannot reach host database'"), categories: z .array(z.string()) .optional() .describe("Optional category slugs to filter by (e.g. ['typescript', 'docker'])"), }, { title: "Search solutions", readOnlyHint: true, openWorldHint: true, }, async ({ query, categories }) => { const params = new URLSearchParams({ q: query }); if (categories && categories.length > 0) { params.set("categories", categories.join(",")); } const res = await apiRequest("GET", `/solutions?${params.toString()}`); return formatResult(res); }, ); - src/index.ts:156-166 (helper)The formatResult helper function used by the handler to format API responses into the MCP content format. Handles both success and error responses.
function formatResult(res: ApiResponse): { content: { type: "text"; text: string }[]; isError?: boolean } { if (!res.ok) { return { content: [{ type: "text" as const, text: JSON.stringify(res.data, null, 2) }], isError: true, }; } return { content: [{ type: "text" as const, text: JSON.stringify(res.data, null, 2) }], }; }