addCompany
Create new company records in Mews hospitality platform by entering company details like name, tax ID, contact information, and billing email.
Instructions
Adds a new company
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Name | Yes | Company name | |
| TaxIdentifier | No | Tax identification number | |
| No | Company email address | ||
| Phone | No | Company phone number | |
| WebsiteUrl | No | Company website URL | |
| InvoicingEmail | No | Billing email address | |
| ContactPersonId | No | Contact person customer ID |
Implementation Reference
- src/tools/companies/addCompany.ts:44-57 (handler)The async execute method implementing the core logic of the addCompany tool: parses input arguments and sends a POST request to the Mews API endpoint '/api/connector/v1/companies/add', returning the JSON result.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; const requestData = { ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/companies/add', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema for the addCompany tool, defining object properties like Name (required), TaxIdentifier, Email, Phone, WebsiteUrl, InvoicingEmail, ContactPersonId with descriptions.inputSchema: { type: 'object', properties: { Name: { type: 'string', description: 'Company name' }, TaxIdentifier: { type: 'string', description: 'Tax identification number' }, Email: { type: 'string', description: 'Company email address' }, Phone: { type: 'string', description: 'Company phone number' }, WebsiteUrl: { type: 'string', description: 'Company website URL' }, InvoicingEmail: { type: 'string', description: 'Billing email address' }, ContactPersonId: { type: 'string', description: 'Contact person customer ID' } }, required: ['Name'], additionalProperties: false },
- src/tools/index.ts:16-16 (registration)Import statement for the addCompanyTool from its dedicated implementation file.import { addCompanyTool } from './companies/addCompany.js';
- src/tools/index.ts:99-103 (registration)Registration of addCompanyTool within the allTools array (alongside other company tools), used for tool discovery, definitions, and execution lookup via toolMap.// Company tools getAllCompaniesTool, addCompanyTool, updateCompaniesTool, deleteCompaniesTool,