create_client
Add new clients to the Frihet MCP Server for generating invoices and quotes. Provide client name and optional contact details to create customer records.
Instructions
Create a new client/customer. Requires at minimum a name. Clients are used when creating invoices and quotes. / Crea un nuevo cliente. Requiere como minimo un nombre. Los clientes se usan al crear facturas y presupuestos.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Client/company name / Nombre del cliente o empresa | |
| No | Email address / Correo electronico | ||
| phone | No | Phone number / Telefono | |
| taxId | No | Tax ID (NIF/CIF/VAT) / NIF o CIF | |
| address | No | Client address / Direccion del cliente |
Implementation Reference
- src/tools/clients.ts:96-105 (handler)The handler function for the 'create_client' tool that executes the tool logic - receives input, calls client.createClient(), and returns the formatted result
async (input) => { try { const result = await client.createClient(input); return { content: [{ type: "text", text: formatRecord("Client created", result) }], }; } catch (error) { return handleToolError(error); } }, - src/tools/clients.ts:78-95 (registration)Tool registration for 'create_client' including the tool name, title, description, annotations, and inputSchema with Zod validation for name, email, phone, taxId, and address fields
server.registerTool( "create_client", { title: "Create Client", description: "Create a new client/customer. Requires at minimum a name. " + "Clients are used when creating invoices and quotes. " + "/ Crea un nuevo cliente. Requiere como minimo un nombre. " + "Los clientes se usan al crear facturas y presupuestos.", annotations: CREATE_ANNOTATIONS, inputSchema: { name: z.string().describe("Client/company name / Nombre del cliente o empresa"), email: z.string().optional().describe("Email address / Correo electronico"), phone: z.string().optional().describe("Phone number / Telefono"), taxId: z.string().optional().describe("Tax ID (NIF/CIF/VAT) / NIF o CIF"), address: addressSchema, }, }, - src/types.ts:93-94 (schema)TypeScript type definition for CreateClientInput - requires 'name' and optionally allows email, phone, taxId, and address fields
export type CreateClientInput = Pick<Client, "name"> & Partial<Pick<Client, "email" | "phone" | "taxId" | "address">>; - src/client.ts:259-261 (helper)The FrihetClient.createClient method that makes the actual HTTP POST request to '/clients' endpoint
async createClient(data: Record<string, unknown>): Promise<Record<string, unknown>> { return this.request("POST", "/clients", data); } - src/client-interface.ts:30-30 (schema)Interface definition for createClient method in IFrihetClient - defines the contract that both local and remote client implementations must satisfy
createClient(data: Record<string, unknown>): Promise<Record<string, unknown>>;