get_account
Retrieve current user account details from the Kapiti platform for management and operational purposes.
Instructions
Get current account information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:522-544 (handler)The handler function for the 'get_account' tool. It sends a GET request to the '/tools/membership/account' endpoint using the configured axios client and returns the account data as formatted JSON text or an error message.async () => { try { const response: AxiosResponse<ApiResponse<Account>> = await apiClient.get(`/tools/membership/account`); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } }
- src/index.ts:515-545 (registration)Registers the 'get_account' tool with the MCP server, specifying its name, metadata (title, description), empty input schema, and the handler function.server.registerTool( "get_account", { title: "Get Account", description: "Get current account information", inputSchema: {}, }, async () => { try { const response: AxiosResponse<ApiResponse<Account>> = await apiClient.get(`/tools/membership/account`); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } } );
- src/index.ts:66-75 (schema)TypeScript interface defining the structure of the Account object, used in the response type ApiResponse<Account> of the get_account tool.interface Account { id: string; name: string; description?: string; website?: string; contactEmail?: string; contactPhone?: string; createdAt: string; updatedAt: string; }