Skip to main content
Glama

gitea_user_current

Retrieve details about the currently authenticated user in Gitea, including profile information and account status.

Instructions

Get information about the currently authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:546-586 (registration)
    Registers the 'gitea_user_current' MCP tool. Includes the tool schema (title and description, no input parameters), and the inline handler function that calls GiteaClient.getCurrentUser() and returns formatted user information or error.
    mcpServer.registerTool( 'gitea_user_current', { title: '获取当前用户', description: 'Get information about the currently authenticated user', }, async (_args: any, _extra: any) => { try { const user = await ctx.client.getCurrentUser(); return { content: [ { type: 'text' as const, text: JSON.stringify( { id: user.id, login: user.login, full_name: user.full_name, email: user.email, avatar_url: user.avatar_url, }, null, 2 ), }, ], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text' as const, text: `Error: ${errorMessage}`, }, ], isError: true, }; } } );
  • Implementation of GiteaClient.getCurrentUser() method, which performs a GET request to the Gitea API endpoint '/api/v1/user' to retrieve the current authenticated user's information.
    /** * 获取当前认证用户信息 */ async getCurrentUser(): Promise<{ id: number; login: string; full_name: string; email: string; avatar_url: string; }> { return this.get('/user'); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SupenBysz/gitea-mcp-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server