Skip to main content
Glama
collapseindex

CI-1T Prediction Stability Engine

list_api_keys

List all API keys for your account. Each key shows name, masked key, scope, and status to help you control access.

Instructions

List all API keys for the authenticated user. Response: { keys: [{ id, name, masked_key, scope, enabled, created }] }. Use the record id with delete_api_key to revoke.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesYour user ID (shown on your dashboard)

Implementation Reference

  • Tool handler for 'list_api_keys' – requires API key auth, accepts a user_id parameter, and sends a GET request to /api/api-keys?userId=... using the configured API key headers. Returns the JSON result via formatResult.
    server.tool(
      "list_api_keys",
      "List all API keys for the authenticated user. Response: { keys: [{ id, name, masked_key, scope, enabled, created }] }. Use the record id with delete_api_key to revoke.",
      {
        user_id: z.string().describe("Your user ID (shown on your dashboard)"),
      },
      async ({ user_id }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const result = await apiFetch(`/api/api-keys?userId=${encodeURIComponent(user_id)}`, {
          method: "GET",
          headers: apiKeyHeaders(),
        });
        return formatResult(result);
      }
    );
  • Input schema for the 'list_api_keys' tool – requires a single string parameter 'user_id' validated by Zod.
    {
      user_id: z.string().describe("Your user ID (shown on your dashboard)"),
    },
  • src/index.ts:705-720 (registration)
    Registration of 'list_api_keys' as a tool on the MCP server via server.tool(). No separate registration file – it's inline in src/index.ts.
    server.tool(
      "list_api_keys",
      "List all API keys for the authenticated user. Response: { keys: [{ id, name, masked_key, scope, enabled, created }] }. Use the record id with delete_api_key to revoke.",
      {
        user_id: z.string().describe("Your user ID (shown on your dashboard)"),
      },
      async ({ user_id }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const result = await apiFetch(`/api/api-keys?userId=${encodeURIComponent(user_id)}`, {
          method: "GET",
          headers: apiKeyHeaders(),
        });
        return formatResult(result);
      }
    );
  • Helper function called by the list_api_keys handler to format the API response as MCP text content.
    function formatResult(result: ApiResult): { content: Array<{ type: "text"; text: string }> } {
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(result.data, null, 2),
          },
        ],
      };
    }
  • Helper function used by the list_api_keys handler to attach the X-API-Key header to the HTTP request.
    function apiKeyHeaders(extra?: Record<string, string>): Record<string, string> {
      const h: Record<string, string> = { "Content-Type": "application/json" };
      if (API_KEY) h["X-API-Key"] = API_KEY;
      return { ...h, ...extra };
    }
Behavior3/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 describes the operation as listing keys and gives response format, but does not disclose behavioral traits like authentication requirements, rate limits, or behavior when no keys exist.

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 consists of two brief sentences: the first states purpose, the second provides response format and a usage hint. No extraneous information.

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

Completeness4/5

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

For a simple listing tool with one required parameter and no output schema, the description includes the response structure. However, it does not address edge cases like empty results or pagination, but remains sufficient for basic use.

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 the single parameter user_id, which is already described in the schema. The description adds no additional meaning beyond the schema.

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 'List all API keys for the authenticated user', specifying the verb, resource, and scope. It also includes response format, distinguishing itself from sibling tools like create_api_key and delete_api_key.

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 provides a usage hint directing to use record id with delete_api_key for revocation. However, it does not explicitly state when to use this tool vs alternatives or exclude inappropriate contexts.

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/collapseindex/ci-1t-mcp'

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