get-current-user
Retrieve current user information from Shortcut project management to identify who is logged in and access user-specific data for personalized workflows.
Instructions
Get the current user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/user.ts:20-26 (handler)The handler function that executes the tool logic: fetches the current user from the Shortcut client and returns a formatted result.async getCurrentUser() { const user = await this.client.getCurrentUser(); if (!user) throw new Error("Failed to retrieve current user."); return this.toResult(`Current user:`, user); }
- src/tools/user.ts:9-13 (registration)Registers the 'get-current-user' tool with the MCP server, including name, description, and handler reference.server.tool( "get-current-user", "Get the current user", async () => await tools.getCurrentUser(), );
- src/tools/base.ts:462-471 (helper)Helper method in BaseTools used by the handler to format the response as MCP CallToolResult with text content containing the user data.protected toResult(message: string, data?: unknown): CallToolResult { return { content: [ { type: "text", text: `${message}${data !== undefined ? `\n\n${JSON.stringify(data, null, 2)}` : ""}`, }, ], }; }