Skip to main content
Glama

List models

listModels

Retrieve models tracked in Langfuse for cost and token attribution, with pagination to manage result sets.

Instructions

List models known to Langfuse (for cost / token attribution).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default 1)
limitNoItems per page (default 50, max 100)

Implementation Reference

  • The handler function that executes the listModels tool logic - sends a GET request to /api/public/models endpoint and returns JSON results (line 315 is the handler, but the full registration spans 308-316).
    async (args) => asJson(await client.get("/api/public/models", args)),
  • Input schema for listModels: uses paginationShape (page and limit) for pagination.
    inputSchema: { ...paginationShape },
  • src/tools.ts:308-316 (registration)
    Registration of the listModels tool via server.registerTool with title, description, input schema, and handler.
    server.registerTool(
      "listModels",
      {
        title: "List models",
        description: "List models known to Langfuse (for cost / token attribution).",
        inputSchema: { ...paginationShape },
      },
      async (args) => asJson(await client.get("/api/public/models", args)),
    );
  • The paginationShape schema used as input schema for listModels, defining optional page and limit parameters.
    export const paginationShape = {
      page: z.number().int().positive().optional().describe("Page number (default 1)"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Items per page (default 50, max 100)"),
    };
  • The asJson helper used by the listModels handler to wrap API responses into MCP text content format.
    const asJson = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the basic listing action and purpose, but does not disclose that the tool is read-only, whether authentication is needed, or that it supports pagination (though parameters imply it). No mention of side effects or data freshness.

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

Conciseness4/5

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

The description is a single sentence with no unnecessary words. It efficiently conveys the core purpose and context. Slightly more detail about pagination or the nature of 'models known to Langfuse' could be added without harming conciseness.

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

Completeness3/5

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

For a simple list tool with well-documented parameters and no output schema, the description adequately states the purpose and source. However, it lacks information about response structure, ordering, or any filters beyond pagination. It is minimally complete but could be more helpful.

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

Parameters3/5

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

Schema coverage is 100% for both parameters (page, limit) with clear descriptions in the schema itself. The description adds no additional parameter context, but the schema already provides enough meaning. Baseline score of 3 is appropriate per guidelines.

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

Purpose5/5

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

The description clearly states it 'List models known to Langfuse' with a specific purpose 'for cost / token attribution.' The verb 'list' and resource 'models' are explicit, and the scope 'known to Langfuse' differentiates it from retrieval of single models (getModel) or other list tools.

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

Usage Guidelines3/5

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

The description implies usage for cost/token attribution but provides no explicit guidance on when to use this tool versus alternatives, such as getModel for a specific model or other list tools. There is no mention of prerequisites or exclusion criteria.

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

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/hugoles/langfuse-mcp'

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