Skip to main content
Glama
collapseindex

CI-1T Prediction Stability Engine

delete_api_key

Remove an API key by providing its PocketBase record ID to revoke access.

Instructions

Delete an API key by its PocketBase record ID (from list_api_keys). Response: { deleted: true }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesPocketBase record ID of the API key to delete

Implementation Reference

  • src/index.ts:786-801 (registration)
    Registration of the 'delete_api_key' tool using server.tool(), defining its schema and handler function.
    server.tool(
      "delete_api_key",
      "Delete an API key by its PocketBase record ID (from list_api_keys). Response: { deleted: true }.",
      {
        id: z.string().describe("PocketBase record ID of the API key to delete"),
      },
      async ({ id }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const result = await apiFetch(`/api/api-keys?id=${encodeURIComponent(id)}`, {
          method: "DELETE",
          headers: apiKeyHeaders(),
        });
        return formatResult(result);
      }
    );
  • Input schema for delete_api_key: accepts a single 'id' string parameter (PocketBase record ID).
    {
      id: z.string().describe("PocketBase record ID of the API key to delete"),
    },
  • Handler function for delete_api_key. Checks auth, then sends a DELETE request to /api/api-keys?id=<id> with API key headers, and returns the formatted result.
    async ({ id }) => {
      const guard = requireApiKey();
      if (guard) return guard;
      const result = await apiFetch(`/api/api-keys?id=${encodeURIComponent(id)}`, {
        method: "DELETE",
        headers: apiKeyHeaders(),
      });
      return formatResult(result);
    }
  • The apiKeyHeaders() helper function used by the handler to add X-API-Key auth headers.
    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 };
    }
  • The formatResult() helper used to format the API response into 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),
          },
        ],
      };
    }
Behavior3/5

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

No annotations provided, so description must disclose behavior. It states deletion and response format but does not mention irreversibility, authorization needs, or side effects. Adequate for a simple delete operation.

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?

Two sentences covering purpose, usage hint, and response format. No redundancy or unnecessary information.

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

Completeness5/5

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

For a single-parameter deletion tool, the description provides all essential information: what it does, what input is needed, and what response to expect. No gaps.

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?

Schema already describes the 'id' parameter well, and the tool description adds value by specifying the source (from list_api_keys), aiding correct invocation. Schema coverage is 100%, so baseline 3 incremented to 4.

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?

Clear verb+resource (delete API key) and specifies how to identify it (by PocketBase record ID from list_api_keys), distinguishing it from sibling tools like create_api_key and list_api_keys.

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

Usage Guidelines4/5

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

Provides a prerequisite: ID must come from list_api_keys. No explicit when-not-to-use or alternatives, but context implies using after listing keys.

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