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
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | The ID of the model to retrieve |
Implementation Reference
- src/operations/models.ts:31-36 (handler)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); }
- src/operations/models.ts:19-21 (schema)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); } }, });