Skip to main content
Glama

Get User Info

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get current user information' but doesn't clarify what 'current' means (e.g., logged-in user, default user), whether it's a read-only operation, what permissions are required, or the format of returned data. This leaves significant gaps in understanding the tool's behavior beyond basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence ('Get current user information'), which is front-loaded and wastes no words. For a simple tool with no parameters, this brevity is effective and appropriate, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 params, no output schema, no annotations), the description is minimal but incomplete. It lacks details on behavioral aspects like authentication needs, data format, or error handling. While the schema handles inputs, the description should provide more context for a tool that retrieves user information, especially without annotations to fill in gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, which is appropriate here. Baseline is 4 for 0 params, as the schema fully covers the absence of inputs, and the description doesn't need to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('current user information'), making the tool's purpose understandable. However, it doesn't differentiate from potential sibling tools that might also retrieve user information (though none are listed in siblings), so it's not fully specific. The verb+resource combination is straightforward but lacks nuance about what 'information' entails.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for 'current user' (e.g., authentication needed), or compare it to other tools like 'get_article' or 'get_comments'. Without such guidance, an agent might struggle to select this tool appropriately in scenarios involving user data retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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