yuque_get_user
Retrieve authenticated user's account details from Yuque, including profile and identification data.
Instructions
获取当前用户信息 (Get current user information)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "yuque_get_user"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/handlers.ts:103-113 (handler)The handler function that executes the 'yuque_get_user' tool logic. It calls client.getUser() and returns the user info as JSON text content.
async function handleGetUser(client: YuqueClient) { const user = await client.getUser(); return { content: [ { type: 'text', text: JSON.stringify(user, null, 2), }, ], }; } - src/tools/definitions.ts:12-19 (registration)Registration/schema definition of the 'yuque_get_user' tool. It has no required input parameters (empty schema).
{ name: 'yuque_get_user', description: '获取当前用户信息 (Get current user information)', inputSchema: { type: 'object', properties: {}, }, }, - src/tools/handlers.ts:23-97 (handler)The switch-case dispatch in the main handleTool function that routes 'yuque_get_user' to the handleGetUser function.
switch (name) { case 'yuque_get_user': return await handleGetUser(client); case 'yuque_get_repos': return await handleGetRepos(client, args as { userId?: string }); case 'yuque_get_docs': return await handleGetDocs( client, args as { repoId: number; limit?: number; offset?: number } ); case 'yuque_get_doc': return await handleGetDoc( client, args as { docId: number; repoId: number } ); case 'yuque_create_doc': return await handleCreateDoc( client, args as { repoId: number; title: string; content: string; format?: 'markdown' | 'lake' | 'html'; } ); case 'yuque_update_doc': return await handleUpdateDoc( client, args as { docId: number; repoId: number; title?: string; content?: string; format?: 'markdown' | 'lake' | 'html'; } ); case 'yuque_delete_doc': return await handleDeleteDoc( client, args as { docId: number; repoId: number } ); case 'yuque_search_docs': return await handleSearchDocs( client, args as { query: string; repoId?: number } ); case 'yuque_create_repo': return await handleCreateRepo( client, args as { name: string; description?: string; isPublic?: boolean; } ); default: throw new Error(`Unknown tool: ${name}`); } } catch (error) { throw new Error( `Error executing ${name}: ${ error instanceof Error ? error.message : String(error) }` ); } } - src/yuque-client.ts:152-154 (helper)The YuqueClient.getUser() method used by the handler. It makes a GET request to the '/user' endpoint of the Yuque API.
async getUser(): Promise<YuqueUser> { return this.request<YuqueUser>('/user'); } - src/yuque-client.ts:10-22 (helper)The YuqueUser type/interface definition returned by the getUser method.
export interface YuqueUser { id: number; type: string; login: string; name: string; description?: string; avatar_url: string; public: number; followers_count: number; following_count: number; created_at: string; updated_at: string; }