Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYesSearch query (e.g. 'bench press', 'squat')

Implementation Reference

  • 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 };
        }
      },
    );
  • The actual API request implementation for searching exercises.
    async searchExercises(query: string): Promise<unknown> {
      return this.request(`/api/v1/search/exercises?q=${encodeURIComponent(query)}`);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/csjoblom/musclesworked-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server