search_exercises
Find exercise IDs by searching for specific workout movements to analyze muscle activation or discover alternatives.
Instructions
Search for exercises by name. Returns matching exercise IDs and names. Use this to discover exercise IDs before calling get_muscles_worked or get_alternatives.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (e.g. 'bench press', 'squat') |
Implementation Reference
- src/tools.ts:145-163 (handler)Registration and handler definition for the search_exercises tool.
server.tool( "search_exercises", "Search for exercises by name. Returns matching exercise IDs and names. " + "Use this to discover exercise IDs before calling get_muscles_worked or get_alternatives.", { query: z .string() .min(2) .describe("Search query (e.g. 'bench press', 'squat')"), }, async ({ query }) => { try { const result = await client.searchExercises(query); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (err) { return { content: [{ type: "text", text: formatError(err) }], isError: true }; } }, ); - src/client.ts:93-95 (helper)The actual API request implementation for searching exercises.
async searchExercises(query: string): Promise<unknown> { return this.request(`/api/v1/search/exercises?q=${encodeURIComponent(query)}`); }