Skip to main content
Glama
He110te4m

MCP Tool Starter Kit

by He110te4m

getUserInfo

Fetch user information from an API by providing a user ID to retrieve specific user data.

Instructions

Fetches user information from an API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes

Implementation Reference

  • The main handler function for the getUserInfo tool. It parses input, fetches user data using fetchUser, and returns the user info as JSON or an error message.
    export async function getUserInfoHandler(input: unknown) {
      const args = input as { userId: string }
      try {
        const user = await fetchUser(args.userId)
        return {
          content: [{ type: 'text', text: JSON.stringify(user) }],
        }
      }
      catch (error) {
        return {
          content: [{ type: 'text', text: (error as Error).message }],
          isError: true,
        }
      }
    }
  • Tool definition including name, description, and input schema that requires a userId string.
    export const getUserInfoTool: Tool = {
      name: 'getUserInfo',
      description: 'Fetches user information from an API',
      inputSchema: {
        type: 'object',
        properties: {
          userId: { type: 'string' },
        },
        required: ['userId'],
      },
    }
  • src/server.ts:34-44 (registration)
    Registers the getUserInfoTool in the server's list tools response handler.
    server.setRequestHandler(ListToolsRequestSchema, async (request) => {
      if (isDebug) {
        console.error(
          'Received ListToolsRequest:',
          JSON.stringify(request, null, 2),
        )
      }
      return {
        tools: [getUserInfoTool],
      }
    })
  • src/server.ts:53-55 (registration)
    Dispatches tool calls named 'getUserInfo' to the getUserInfoHandler function in the call tool request handler.
    if (request.params.name === getUserInfoTool.name) {
      return getUserInfoHandler(request.params.arguments)
    }
  • Helper function that mocks fetching user information based on userId.
    async function fetchUser(userId: string) {
      if (userId === '1') {
        return { id: '1', name: 'John Doe' }
      }
      throw new Error('User not found')
    }
Behavior1/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 fails to describe any behavioral traits beyond the basic action, such as whether it's read-only, requires authentication, has rate limits, returns structured data, or handles errors. The description is minimal and lacks essential operational details.

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 ('Fetches user information from an API'), which is front-loaded and wastes no words. It efficiently communicates the core purpose without unnecessary elaboration, making it easy to parse quickly.

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

Completeness1/5

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

Given the tool's complexity (a data retrieval operation), lack of annotations, no output schema, and poor parameter documentation, the description is incomplete. It doesn't cover what information is fetched, how results are formatted, error handling, or any behavioral aspects, leaving significant gaps for an AI agent to use it correctly.

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

Parameters1/5

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

The input schema has 1 parameter with 0% description coverage, meaning the schema provides no details about 'userId'. The description adds no parameter semantics—it doesn't explain what 'userId' is (e.g., format, source, examples) or how it's used. This leaves the parameter undocumented and unclear.

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

Purpose3/5

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

The description states the action ('fetches') and resource ('user information'), which provides a basic understanding of what the tool does. However, it's vague about what specific user information is retrieved (e.g., profile details, permissions, contact info) and doesn't distinguish from siblings (though none exist). It avoids tautology by not just restating the name.

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, such as prerequisites (e.g., authentication needed), alternatives (not applicable as no siblings), or specific contexts (e.g., for user lookup vs. bulk queries). It only states the basic function without usage context.

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

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/He110te4m/mcp-starter'

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