Skip to main content
Glama
op-enny
by op-enny

fakestore_add_user

Add a new user to the Fake Store API for testing or demonstration purposes. This simulation tool accepts user details like email, username, address, and contact information.

Instructions

Add a new user (simulation - does not persist)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesUser email address
usernameYesUsername
passwordYesUser password
firstnameYesFirst name
lastnameYesLast name
cityYesCity
streetYesStreet name
numberYesStreet number
zipcodeYesZIP code
latYesLatitude
longYesLongitude
phoneYesPhone number

Implementation Reference

  • Core handler function that validates input parameters and sends a POST request to the FakeStore API to simulate adding a new user.
    export async function addUser(args: {
      email: string;
      username: string;
      password: string;
      firstname: string;
      lastname: string;
      city: string;
      street: string;
      number: number;
      zipcode: string;
      lat: string;
      long: string;
      phone: string;
    }): Promise<User> {
      const {
        email,
        username,
        password,
        firstname,
        lastname,
        city,
        street,
        number,
        zipcode,
        lat,
        long,
        phone,
      } = args;
    
      // Basic validation
      validateEmail(email);
      validatePhone(phone);
    
      if (!username || typeof username !== 'string') {
        throw new Error('Username must be a non-empty string');
      }
      if (!password || typeof password !== 'string') {
        throw new Error('Password must be a non-empty string');
      }
      if (!firstname || typeof firstname !== 'string') {
        throw new Error('First name must be a non-empty string');
      }
      if (!lastname || typeof lastname !== 'string') {
        throw new Error('Last name must be a non-empty string');
      }
    
      return post<User>('/users', {
        email,
        username,
        password,
        name: {
          firstname,
          lastname,
        },
        address: {
          city,
          street,
          number,
          zipcode,
          geolocation: {
            lat,
            long,
          },
        },
        phone,
      });
    }
  • Input schema definition for the fakestore_add_user tool, specifying properties, types, descriptions, and required fields.
    {
      name: 'fakestore_add_user',
      description: 'Add a new user (simulation - does not persist)',
      inputSchema: {
        type: 'object',
        properties: {
          email: {
            type: 'string',
            description: 'User email address',
          },
          username: {
            type: 'string',
            description: 'Username',
          },
          password: {
            type: 'string',
            description: 'User password',
          },
          firstname: {
            type: 'string',
            description: 'First name',
          },
          lastname: {
            type: 'string',
            description: 'Last name',
          },
          city: {
            type: 'string',
            description: 'City',
          },
          street: {
            type: 'string',
            description: 'Street name',
          },
          number: {
            type: 'number',
            description: 'Street number',
          },
          zipcode: {
            type: 'string',
            description: 'ZIP code',
          },
          lat: {
            type: 'string',
            description: 'Latitude',
          },
          long: {
            type: 'string',
            description: 'Longitude',
          },
          phone: {
            type: 'string',
            description: 'Phone number',
          },
        },
        required: ['email', 'username', 'password', 'firstname', 'lastname', 'city', 'street', 'number', 'zipcode', 'lat', 'long', 'phone'],
      },
    },
  • src/index.ts:183-201 (registration)
    Registration and dispatch logic in the main CallToolRequestSchema handler that invokes the addUser function when the tool name matches.
    if (name === 'fakestore_add_user') {
      const result = await addUser(args as {
        email: string;
        username: string;
        password: string;
        firstname: string;
        lastname: string;
        city: string;
        street: string;
        number: number;
        zipcode: string;
        lat: string;
        long: string;
        phone: string;
      });
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • src/index.ts:42-42 (registration)
    Tool list registration where userTools (including fakestore_add_user schema) is combined and returned in ListToolsRequestSchema handler.
    tools: [...productTools, ...cartTools, ...userTools],
  • src/index.ts:20-20 (registration)
    Import statement that brings in the addUser handler and userTools (with schema) from users.ts.
    import { userTools, getAllUsers, getUserById, addUser, updateUser, deleteUser } from './tools/users.js';
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It successfully communicates the critical behavioral trait that this is a simulation that 'does not persist' - essential information that wouldn't be captured in annotations. However, it doesn't describe what the tool actually returns or how the simulation behaves.

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 perfectly concise - just 7 words that communicate both the primary function and the critical behavioral constraint. Every word earns its place, and the most important information (simulation nature) is included.

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

Completeness3/5

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

For a tool with 12 required parameters and no output schema, the description provides essential behavioral context about it being a simulation. However, it doesn't explain what the tool returns or provide guidance on the simulation's behavior, leaving gaps in understanding how to interpret results.

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

Parameters3/5

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

The schema description coverage is 100%, with all 12 parameters clearly documented in the schema. The description doesn't add any additional parameter information beyond what's already in the schema, so it meets the baseline of 3 for high schema coverage without adding extra value.

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

Purpose5/5

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

The description clearly states the specific action ('Add a new user') and distinguishes it from sibling tools by specifying the resource type (user). It also includes the critical qualifier 'simulation - does not persist' which differentiates it from actual persistence tools in the fakestore system.

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

Usage Guidelines4/5

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

The description provides clear context that this is a simulation tool, which implicitly guides when to use it (for testing/demo purposes rather than real data persistence). However, it doesn't explicitly mention when NOT to use it or name specific alternatives among the sibling tools.

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/op-enny/mcp-server-fakestore'

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