get_alternatives
Find alternative exercises based on muscle overlap scores to replace or supplement workouts while targeting similar muscle groups.
Instructions
Find alternative exercises ranked by muscle overlap score. Use search_exercises first if you don't know the exercise ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exercise | Yes | Exercise ID or name | |
| limit | No | Max results (default: 10) |
Implementation Reference
- src/client.ts:86-91 (handler)The implementation of getAlternatives in the MusclesWorkedClient that makes the API request.
async getAlternatives(exercise: string, limit?: number): Promise<unknown> { const params = limit !== undefined ? `?limit=${limit}` : ""; return this.request( `/api/v1/exercises/${encodeURIComponent(exercise)}/alternatives${params}`, ); } - src/tools.ts:121-143 (registration)Registration of the get_alternatives MCP tool.
server.tool( "get_alternatives", "Find alternative exercises ranked by muscle overlap score. " + "Use search_exercises first if you don't know the exercise ID.", { exercise: z.string().describe("Exercise ID or name"), limit: z .number() .int() .min(1) .max(50) .optional() .describe("Max results (default: 10)"), }, async ({ exercise, limit }) => { try { const result = await client.getAlternatives(exercise, limit); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (err) { return { content: [{ type: "text", text: formatError(err) }], isError: true }; } }, );