Skip to main content
Glama

generate-person

Generate realistic fake person data for testing and development, including names, contact details, and addresses with customizable options.

Instructions

Generates fake person data including names, emails, phone numbers, and addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of person records to generate
localeNoLocale for generated dataen
seedNoOptional seed for reproducible generation
includeAddressNoWhether to include address information
includePhoneNoWhether to include phone number
includeDateOfBirthNoWhether to include date of birth

Implementation Reference

  • Handler function for the generate-person MCP tool. Validates input parameters using Zod schema, generates fake person data using PersonGenerator (single or batch), computes metadata, and returns an MCP response with text summary and JSON resource containing the data.
    export function handleGeneratePerson(args: unknown): Promise<{ content: unknown[] }> {
      const startTime = Date.now();
    
      try {
        // Validate and parse arguments
        const params = GeneratePersonSchema.parse(args);
    
        // Create generator
        const generator = new PersonGenerator({
          seed: params.seed,
          locale: params.locale,
        });
    
        // Generate data
        const data =
          params.count === 1
            ? [
                generator.generate({
                  includeAddress: params.includeAddress,
                  includePhone: params.includePhone,
                  includeDateOfBirth: params.includeDateOfBirth,
                }),
              ]
            : generator.generateMany(params.count, {
                includeAddress: params.includeAddress,
                includePhone: params.includePhone,
                includeDateOfBirth: params.includeDateOfBirth,
              });
    
        const generationTimeMs = Date.now() - startTime;
    
        // Build response
        const metadata = {
          count: data.length,
          seed: generator.getSeed(),
          locale: generator.getLocale(),
          generationTimeMs,
        };
    
        const responseText = params.seed
          ? `Generated ${data.length} person record${data.length > 1 ? 's' : ''} with seed ${params.seed}`
          : `Generated ${data.length} person record${data.length > 1 ? 's' : ''}`;
    
        return Promise.resolve({
          content: [
            {
              type: 'text',
              text: responseText,
            },
            {
              type: 'resource',
              resource: {
                uri: 'faker://persons/generated',
                mimeType: 'application/json',
                text: JSON.stringify({ data, metadata }, null, 2),
              },
            },
          ],
        });
      } catch (error) {
        if (error instanceof z.ZodError) {
          throw new Error(
            `Invalid parameters: ${error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ')}`
          );
        }
        throw error;
      }
    }
  • Zod validation schema defining input parameters for the generate-person tool, including count, locale, seed, and flags for including address, phone, and date of birth.
    export const GeneratePersonSchema = z.object({
      count: z.number().min(1).max(10000).default(1).describe('Number of person records to generate'),
      locale: z
        .nativeEnum(SupportedLocale)
        .default(SupportedLocale.EN)
        .describe('Locale for generated data'),
      seed: z.number().optional().describe('Optional seed for reproducible generation'),
      includeAddress: z.boolean().default(true).describe('Whether to include address information'),
      includePhone: z.boolean().default(true).describe('Whether to include phone number'),
      includeDateOfBirth: z.boolean().default(false).describe('Whether to include date of birth'),
    });
  • MCP Tool definition object for generate-person, including name, description, and input schema derived from Zod schema using zod-to-json-schema.
    export const generatePersonTool: Tool = {
      name: 'generate-person',
      description: 'Generates fake person data including names, emails, phone numbers, and addresses',
      inputSchema: zodToJsonSchema(GeneratePersonSchema) as Tool['inputSchema'],
    };
  • src/index.ts:21-21 (registration)
    Registration of the generate-person tool with the FakerMCPServer by passing the tool definition and handler function.
    server.registerTool(generatePersonTool, handleGeneratePerson);
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what data is generated without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, if it has side effects, rate limits, authentication needs, or what the output format looks like. The description is minimal and lacks crucial operational context.

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 a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for this tool's complexity and front-loads the core functionality without unnecessary elaboration.

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 no annotations and no output schema, the description is incomplete for a tool with 6 parameters. It doesn't explain what the generated data looks like, how it's structured, or provide any context about the generation process. For a data generation tool with multiple configuration options, this leaves significant gaps in understanding.

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?

Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description mentions 'including names, emails, phone numbers, and addresses' which loosely maps to some parameters (includeAddress, includePhone) but doesn't add meaningful semantics beyond what the schema already provides. Baseline 3 is appropriate given complete schema coverage.

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 verb 'generates' and the resource 'fake person data' with specific examples of what's included (names, emails, phone numbers, addresses). It distinguishes from sibling tools like 'generate-company' by focusing on person data, though it doesn't explicitly contrast with 'generate-custom' or 'generate-dataset'.

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 like 'generate-company', 'generate-custom', or 'generate-dataset'. It doesn't mention use cases, prerequisites, or limitations that would help an agent choose between these 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/funsjanssen/faker-mcp'

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