Skip to main content
Glama

create_client

Add a new client for project management and billing. Provide client name and optionally set active status, address, and currency.

Instructions

Create a new client for project management and billing. Requires client name and supports address and currency configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesClient name (required)
is_activeNoWhether the client is active
addressNoClient address
currencyNo3-letter ISO currency code (e.g., USD, EUR)

Implementation Reference

  • The CreateClientHandler class is the MCP tool handler that executes the 'create_client' tool logic. It validates arguments using CreateClientSchema, calls harvestClient.createClient(), and returns the result.
    class CreateClientHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(CreateClientSchema, args, 'create client');
          logger.info('Creating client via Harvest API');
          const client = await this.config.harvestClient.createClient(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(client, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'create_client');
        }
      }
    }
  • The CreateClientSchema defines the input validation schema for creating a client, with fields: name (required), is_active (optional, default true), address (optional), and currency (optional, default 'USD').
    export const CreateClientSchema = z.object({
      name: z.string().min(1, 'Client name is required'),
      is_active: z.boolean().optional().default(true),
      address: z.string().optional(),
      currency: z.string().length(3, 'Currency must be a 3-letter ISO code').optional().default('USD'),
    });
  • The tool registration entry for 'create_client' in the registerClientTools function. It defines the tool name, description, inputSchema (name required, optional is_active, address, currency), and associates the CreateClientHandler.
    {
      tool: {
        name: 'create_client',
        description: 'Create a new client for project management and billing. Requires client name and supports address and currency configuration.',
        inputSchema: {
          type: 'object',
          properties: {
            name: { type: 'string', minLength: 1, description: 'Client name (required)' },
            is_active: { type: 'boolean', description: 'Whether the client is active' },
            address: { type: 'string', description: 'Client address' },
            currency: { type: 'string', minLength: 3, maxLength: 3, description: '3-letter ISO currency code (e.g., USD, EUR)' },
          },
          required: ['name'],
          additionalProperties: false,
        },
      },
      handler: new CreateClientHandler(config),
    },
  • The ClientsClient.createClient() method is the low-level API helper that performs the actual HTTP POST request to Harvest API /clients endpoint, with Zod validation and error handling.
    async createClient(input: CreateClientInput): Promise<any> {
      try {
        const validatedInput = CreateClientSchema.parse(input);
        
        this.logger.debug('Creating client', { name: validatedInput.name });
        const response: AxiosResponse = await this.client.post('/clients', validatedInput);
        
        this.logger.info('Successfully created client', {
          clientId: response.data.id,
          clientName: response.data.name
        });
        
        return response.data;
      } catch (error) {
        if (error instanceof z.ZodError) {
          this.logger.error('Create client validation failed:', error.errors);
          throw new Error('Invalid client input data');
        }
        throw error;
      }
    }
  • src/server.ts:136-136 (registration)
    The server category mapping includes 'create_client' in the 'clients' tool category.
    'clients': ['list_clients', 'get_client', 'create_client', 'update_client', 'delete_client'],
Behavior2/5

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

With no annotations, the description carries full burden but only states creation and parameter support. Missing details on side effects, permissions, error handling, or idempotency. Minimal disclosure beyond the obvious.

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?

Single sentence, every word adds value. No redundancy, front-loaded with action and resource.

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 simple create tool, covers basics: purpose, required, optional fields. However, lacks description of return value (no output schema), uniqueness constraints, or outcome on success/failure.

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?

All parameters have schema descriptions (100% coverage), so baseline is 3. The description confirms required vs optional but adds no new semantics like dependencies or examples.

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 verb 'Create' and the resource 'client', with context 'for project management and billing'. It specifies required and optional parameters, distinguishing it from sibling tools like create_estimate or create_project.

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?

No guidance is given on when to use this tool vs alternatives like update_client or other create tools. An explicit statement about when not to use it or mention of update_client would improve this.

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/ianaleck/harvest-mcp-server'

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