Skip to main content
Glama
kaminari-ad

@kaminari-ad/mcp

Official
by kaminari-ad

Revoke API Key

revoke_api_key
DestructiveIdempotent

Permanently invalidate an API key to block all future requests. Any subsequent use returns a 401 error; this action cannot be reversed.

Instructions

Permanently invalidate an API key. Any subsequent request using it returns 401. Cannot be undone — the user would have to create_api_key again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
key_idYesUUID of the key to revoke (from `list_api_keys`).

Implementation Reference

  • Tool definition with the handler function that calls ctx.api.revokeApiKey(input.key_id) and returns { revoked: true } on success.
    export const revokeApiKeyTool: Tool<RevokeApiKeyInputShape, RevokeApiKeyOutput> = {
      name: "revoke_api_key",
      description:
        "Permanently invalidate an API key. Any subsequent request using it returns 401. Cannot be undone — the user would have to `create_api_key` again.",
      annotations: {
        title: "Revoke API Key",
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: true,
        openWorldHint: false,
      },
      inputSchema: z.object(RevokeApiKeyInputShape),
      handler: async (input, ctx): Promise<Result<RevokeApiKeyOutput, ToolError>> => {
        const result = await ctx.api.revokeApiKey(input.key_id);
        if (result.isErr()) return err(mapApiError(result.error));
        return ok({ revoked: true });
      },
    };
  • Input schema requiring a UUID key_id string, and output type with { revoked: true }.
    const RevokeApiKeyInputShape = {
      key_id: z.string().uuid().describe("UUID of the key to revoke (from `list_api_keys`)."),
    } as const;
    type RevokeApiKeyInputShape = typeof RevokeApiKeyInputShape;
    
    export interface RevokeApiKeyOutput {
      readonly revoked: true;
    }
  • Registration of revokeApiKeyTool in the central tool registry (registerAllTools function).
    register(revokeApiKeyTool);
  • The parseEmpty parser used by the HTTP gateway's revokeApiKey implementation for the 204 No Content response.
    /**
     * Parser for `204 No Content` responses. Ignores the input (which is
     * `null` for a successful empty body, or whatever undici left in `data`)
     * and always returns `Ok(null)`. Used by every mutator that the API
     * answers without echoing the entity back — see e.g. `removeUser`,
     * `revokeApiKey`, `requestPolicySetApproval`, `setAlertDestinationVersion`.
     */
    export function parseEmpty(_raw: unknown): Result<null, ApiError> {
      return ok(null);
    }
  • HTTP gateway implementation that sends a DELETE request to /api/v1/account/api-keys/{key_id}.
    async revokeApiKey(keyId: string): Promise<Result<null, ApiError>> {
      return call(
        "DELETE",
        "/api/v1/account/api-keys/{key_id}",
        { params: { path: { key_id: keyId } } },
        parseEmpty
      );
    },
Behavior5/5

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

With destructiveHint already in annotations, the description adds concrete behavior: subsequent requests return 401, and the action cannot be undone. No contradiction.

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, 31 words, front-loaded with the core action. No fluff.

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 simple, single-parameter destructive tool with no output schema, the description covers all necessary context: effect, persistence, and recovery path.

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?

Input schema covers 100% of the single parameter with clear description ('UUID of the key to revoke'). Tool description adds no additional param details beyond schema, meeting baseline.

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?

Description clearly states 'Permanently invalidate an API key' and distinguishes from sibling 'create_api_key' by noting the irreversible nature and need to recreate.

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

Usage Guidelines5/5

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

Explicitly states when to use (to invalidate a key), emphasizes irreversibility, and points to 'create_api_key' as the alternative for obtaining a new key.

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/kaminari-ad/mcp'

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