List Access Tokens
list_access_tokensList personal access tokens and view their metadata to manage authentication credentials.
Instructions
List personal access tokens (metadata).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/accessTokens.ts:7-16 (handler)The async handler function that executes the list_access_tokens tool logic. It makes a GraphQL query to fetch current user's access tokens (id, name, createdAt, expiresAt) and returns the data.
const listAccessTokensHandler = async () => { try { const query = `query { currentUser { accessTokens { id name createdAt expiresAt } } }`; const data = await gql.request<{ currentUser: { accessTokens: any[] } }>(query); return text(data.currentUser?.accessTokens || []); } catch (error: any) { console.error("List access tokens error:", error.message); return text({ error: error.message }); } }; - src/tools/accessTokens.ts:17-25 (registration)Registration of the tool with the MCP server under the name 'list_access_tokens', including title, description, and empty inputSchema.
server.registerTool( "list_access_tokens", { title: "List Access Tokens", description: "List personal access tokens (metadata).", inputSchema: {} }, listAccessTokensHandler as any ); - src/tools/accessTokens.ts:18-22 (schema)Input/output schema definition for list_access_tokens: has an empty inputSchema (no required inputs), title 'List Access Tokens', and description 'List personal access tokens (metadata).'
"list_access_tokens", { title: "List Access Tokens", description: "List personal access tokens (metadata).", inputSchema: {} - src/toolSurface.ts:45-45 (registration)Tool name listed in the ALL_TOOLS constant array, declaring list_access_tokens as one of the available tools.
"list_access_tokens", - src/toolSurface.ts:135-135 (registration)Permission/scope configuration for list_access_tokens: requires 'access_tokens', 'access_tokens.read', 'admin', or 'read' scopes. Also listed in READ_ONLY_TOOLS set on line 190.
list_access_tokens: ["access_tokens", "access_tokens.read", "admin", "read"],