get_user
Retrieve the current user's details through the Plane MCP Server to facilitate user-specific interactions and management within Plane's project management system.
Instructions
Get the current user's information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/user.ts:6-11 (handler)The handler function for the 'get_user' tool. It fetches the current user's information from the Plane API endpoint 'users/me/' using the makePlaneRequest helper and returns it formatted as JSON in a text content block.server.tool("get_user", "Get the current user's information", {}, async () => { const user = await makePlaneRequest("GET", "users/me/"); return { content: [{ type: "text", text: JSON.stringify(user, null, 2) }], }; });
- src/tools/index.ts:15-15 (registration)Registers the user tools module (including the 'get_user' tool) by invoking registerUserTools on the MCP server.registerUserTools(server);
- src/server.ts:15-15 (registration)Top-level registration of all tools, including 'get_user', by calling registerTools(server).registerTools(server);
- src/common/request-helper.ts:3-36 (helper)Utility function makePlaneRequest, used by the 'get_user' handler to make authenticated API requests to Plane.export async function makePlaneRequest<T>(method: string, path: string, body: any = null): Promise<T> { const hostUrl = process.env.PLANE_API_HOST_URL || "https://api.plane.so/"; const host = hostUrl.endsWith("/") ? hostUrl : `${hostUrl}/`; const url = `${host}api/v1/${path}`; const headers: Record<string, string> = { "X-API-Key": process.env.PLANE_API_KEY || "", }; // Only add Content-Type for non-GET requests if (method.toUpperCase() !== "GET") { headers["Content-Type"] = "application/json"; } try { const config: AxiosRequestConfig = { url, method, headers, }; // Only include body for non-GET requests if (method.toUpperCase() !== "GET" && body !== null) { config.data = body; } const response = await axios(config); return response.data; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Request failed: ${error.message}`); } throw error; } }