Skip to main content
Glama
berthelius

Frihet MCP Server

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
NameRequiredDescriptionDefault
nameYesClient/company name / Nombre del cliente o empresa
emailNoEmail address / Correo electronico
phoneNoPhone number / Telefono
taxIdNoTax ID (NIF/CIF/VAT) / NIF o CIF
addressNoClient address / Direccion del cliente

Implementation Reference

  • 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);
      }
    },
  • 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,
        },
      },
  • 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">>;
  • 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);
    }
  • 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>>;

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/berthelius/frihet-mcp'

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