search_muscles
Find muscle IDs by searching muscle names to identify target muscles before locating exercises that work them.
Instructions
Search for muscles by name. Returns matching muscle IDs and names. Use this to discover muscle IDs before calling find_exercises.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (e.g. 'chest', 'bicep', 'quad') |
Implementation Reference
- src/tools.ts:165-183 (registration)The 'search_muscles' tool is defined and registered using server.tool in src/tools.ts. It takes a 'query' input and invokes client.searchMuscles(query).
server.tool( "search_muscles", "Search for muscles by name. Returns matching muscle IDs and names. " + "Use this to discover muscle IDs before calling find_exercises.", { query: z .string() .min(2) .describe("Search query (e.g. 'chest', 'bicep', 'quad')"), }, async ({ query }) => { try { const result = await client.searchMuscles(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:97-99 (handler)The actual implementation of the searchMuscles method that performs the network request/logic.
async searchMuscles(query: string): Promise<unknown> { return this.request(`/api/v1/search/muscles?q=${encodeURIComponent(query)}`); }