List Api Keys
list_api_keysRetrieve your organization's API keys with details such as ID, key prefix, display name, expiry, and creation date. This endpoint provides key metadata without exposing the full secret.
Instructions
List the organization's API keys: id, key prefix (first 8 chars of the secret), display name, expiry, created_at. The full secret is NEVER returned by this endpoint — only the prefix.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function that executes the list_api_keys tool logic. Calls ctx.api.listApiKeys() and returns the result with items and total count.
handler: async (_input, ctx): Promise<Result<ListApiKeysOutput, ToolError>> => { const result = await ctx.api.listApiKeys(); if (result.isErr()) return err(mapApiError(result.error)); return ok({ items: result.value, total: result.value.length }); }, - Input shape (empty object) and output TypeScript interface (ListApiKeysOutput with items and total).
const ListApiKeysInputShape = {} as const; type ListApiKeysInputShape = typeof ListApiKeysInputShape; export interface ListApiKeysOutput { readonly items: readonly ApiKeyResponse[]; readonly total: number; } - src/application/tool-registry.ts:114-114 (registration)Registration of listApiKeysTool in the central tool registry via register(listApiKeysTool).
register(listApiKeysTool); - HTTP API gateway implementation that makes the actual GET /api/v1/account/api-keys call.
async listApiKeys(): Promise<Result<readonly ApiKeyResponse[], ApiError>> { return call("GET", "/api/v1/account/api-keys", {}, parseApiKeyList); - Domain port interface defining the listApiKeys method contract.
listApiKeys(): Promise<Result<readonly ApiKeyResponse[], ApiError>>;