Skip to main content
Glama
BrewMyTech

Grok MCP Server

by BrewMyTech

get_model

Retrieve detailed information about a specific model using its unique ID from the Grok MCP Server, enabling efficient model management and operations.

Instructions

Get details about a specific model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYesThe ID of the model to retrieve

Implementation Reference

  • The handler function that retrieves a specific model by ID using the Grok API.
    export async function getModel(
      modelId: string
    ): Promise<z.infer<typeof ModelSchema>> {
      const response = await grokRequest(`models/${modelId}`);
      return ModelSchema.parse(response);
    }
  • Zod schema defining the input parameters for the get_model tool.
    export const GetModelSchema = z.object({
      model_id: z.string().describe("The ID of the model to retrieve"),
    });
  • index.ts:83-95 (registration)
    Registration of the "get_model" tool using FastMCP's addTool method.
    server.addTool({
      name: "get_model",
      description: "Get details about a specific model",
      parameters: models.GetModelSchema,
      execute: async (args) => {
        try {
          const result = await models.getModel(args.model_id);
          return JSON.stringify(result, null, 2);
        } catch (err) {
          handleError(err);
        }
      },
    });
Install Server

Other Tools

Related Tools

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/BrewMyTech/grok-mcp'

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