Skip to main content
Glama
BrewMyTech

Grok MCP Server

by BrewMyTech

list_models

Retrieve all available models for use with the Grok API to facilitate seamless integration and selection for AI tasks.

Instructions

List all models available for use with the Grok API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for listing models. It makes a request to the 'models' endpoint via grokRequest and parses the response using ListModelsResponseSchema.
    export async function listModels(): Promise<
      z.infer<typeof ListModelsResponseSchema>
    > {
      const response = await grokRequest("models");
      return ListModelsResponseSchema.parse(response);
    }
  • Zod schema for validating the list models API response, containing an array of ModelSchema objects.
    export const ListModelsResponseSchema = z.object({
      object: z.string(),
      data: z.array(ModelSchema),
    });
  • Zod schema defining the structure of a single model object, used within ListModelsResponseSchema.
    export const ModelSchema = z.object({
      id: z.string(),
      created: z.number().optional(),
      object: z.string(),
      owned_by: z.string().optional(),
    });
  • Empty Zod schema for list models input options (no parameters required).
    export const ListModelsOptionsSchema = z.object({});
  • index.ts:69-81 (registration)
    Tool registration in the FastMCP server. Specifies the tool name, description, input schema, and an execute handler that calls the core listModels function and stringifies the result.
    server.addTool({
      name: "list_models",
      description: "List all models available for use with the Grok API",
      parameters: models.ListModelsOptionsSchema,
      execute: async () => {
        try {
          const result = await models.listModels();
          return JSON.stringify(result, null, 2);
        } catch (err) {
          handleError(err);
        }
      },
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe return format, pagination behavior, rate limits, authentication requirements, or any side effects. The description is minimal and lacks essential operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized for a simple listing tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is insufficiently complete. For a tool that presumably returns a list of models, the description should at minimum hint at the return format or structure. The current description provides only basic purpose without operational context needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the input requirements. The description appropriately doesn't discuss parameters since none exist, which is correct for this case. Baseline 4 applies for zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all models') and the resource ('available for use with the Grok API'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from the sibling 'get_model' tool, which appears to retrieve a specific model rather than list all available ones.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_model' or other sibling tools. It lacks context about prerequisites, typical use cases, or any explicit when/when-not instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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