Skip to main content
Glama

get_user_info

Retrieve current user details from Emlog blog systems using the MCP Server interface. Simplify user information access for streamlined content management and operations.

Instructions

Get current user information

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The handler function for the get_user_info tool. It fetches the current user's information using the EmlogClient and formats it into a text response for MCP.
    async () => { try { const result = await emlogClient.getCurrentUser(); const user = result.userinfo; return { content: [{ type: "text", text: `User: ${user.nickname}\nEmail: ${user.email}\nUID: ${user.uid}\nDescription: ${user.description || 'N/A'}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • src/index.ts:544-571 (registration)
    Registration of the get_user_info tool with the MCP server, including title, description, empty input schema, and inline handler.
    server.registerTool( "get_user_info", { title: "Get User Info", description: "Get current user information", inputSchema: {} }, async () => { try { const result = await emlogClient.getCurrentUser(); const user = result.userinfo; return { content: [{ type: "text", text: `User: ${user.nickname}\nEmail: ${user.email}\nUID: ${user.uid}\nDescription: ${user.description || 'N/A'}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • Tool schema definition with no input parameters required.
    { title: "Get User Info", description: "Get current user information", inputSchema: {} },
  • Supporting method in EmlogClient that makes the API request to retrieve the current user's information.
    async getCurrentUser(): Promise<{ userinfo: EmlogUser }> { const queryParams = this.buildParams(); const response = await this.api.get(`/?rest-api=userinfo&${queryParams.toString()}`); return response.data.data; }
  • TypeScript interface defining the structure of user information returned by the API.
    export interface EmlogUser { uid: number; nickname: string; role: string; avatar: string; email?: string; description: string; ip?: string; create_time: number; }

Other Tools

Related Tools

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/eraincc/emlog-mcp'

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