Skip to main content
Glama

createCompany

Add new companies to Teamwork by providing details like name, address, email, and tags for organization and management.

Instructions

Create a new company. This tool allows you to create a company. The request requires a companyRequest object with various properties like addressOne, emailOne, name, and tags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyRequestYes
optionsNoAdditional options for the request

Implementation Reference

  • Handler function that executes the createCompany tool: extracts companyData from input, validates name, calls teamworkService.createCompany, returns formatted result or error response.
    export async function handleCreateCompany(input: any) {
      logger.info('Calling teamworkService.createCompany()');
      
      try {
        const companyData = input.companyRequest;
        
        if (!companyData || !companyData.name) {
          throw new Error("Company name is required");
        }
        
        const result = await teamworkService.createCompany(companyData);
        logger.info(`Company created successfully with name: ${companyData.name}`);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Creating company');
      }
    } 
  • Tool definition with name, description, detailed inputSchema for companyRequest (name required, optional fields like address, email, etc.), and annotations.
    export const createCompanyDefinition = {
      name: "createCompany",
      description: "Create a new company. This tool allows you to create a company. The request requires a companyRequest object with various properties like addressOne, emailOne, name, and tags.",
      inputSchema: {
        type: 'object',
        properties: {
          companyRequest: {
            type: 'object',
            properties: {
              addressOne: {
                type: 'string',
                description: 'First line of address'
              },
              addressTwo: {
                type: 'string',
                description: 'Second line of address'
              },
              city: {
                type: 'string',
                description: 'City'
              },
              company: {
                type: 'object',
                properties: {
                  name: {
                    type: 'string',
                    description: 'Company name'
                  }
                },
                required: ['name']
              },
              countryCode: {
                type: 'string',
                description: 'Country code'
              },
              emailOne: {
                type: 'string',
                description: 'First email address'
              },
              emailTwo: {
                type: 'string',
                description: 'Second email address'
              },
              fax: {
                type: 'string',
                description: 'Fax number'
              },
              name: {
                type: 'string',
                description: 'Company name'
              },
              phone: {
                type: 'string',
                description: 'Phone number'
              },
              state: {
                type: 'string',
                description: 'State'
              },
              tags: {
                type: 'array',
                items: {
                  type: 'string'
                },
                description: 'List of tags'
              },
              website: {
                type: 'string',
                description: 'Website URL'
              },
              zip: {
                type: 'string',
                description: 'ZIP/Postal code'
              }
            },
            required: ['name']
          },
          options: {
            type: 'object',
            properties: {},
            description: 'Additional options for the request'
          }
        },
        required: ['companyRequest']
      },
      annotations: {
        title: "Create Company",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of createCompany tool in the toolPairs array, pairing the definition with its handler function.
    { definition: createCompany, handler: handleCreateCompany },
  • Helper service function that performs the actual API POST to 'companies.json' to create the company using the API client.
    export const createCompany = async (companyData: any) => {
      try {
        logger.info(`Creating new company with name: ${companyData.name}`);
        
        const api = ensureApiClient();
        const response = await api.post('companies.json', companyData);
        
        logger.info(`Successfully created company. Response status: ${response.status}`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error creating company: ${error.message}`);
        throw new Error(`Failed to create company: ${error.message}`);
      }
    };
Behavior3/5

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

Annotations already indicate this is a write operation (readOnlyHint: false) and non-destructive (destructiveHint: false). The description adds minimal behavioral context by mentioning 'The request requires a companyRequest object' but doesn't disclose important behavioral traits like what happens on duplicate names, whether creation is idempotent, what permissions are required, or what the response contains. With annotations covering basic safety profile, this earns a baseline 3.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise at three sentences, but the second sentence 'This tool allows you to create a company' is completely redundant with the first. The structure could be improved by front-loading the most critical information about required parameters rather than stating the obvious.

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 creation tool with 2 parameters (one complex nested object), no output schema, and only basic annotations, the description provides minimal but adequate context. It identifies the main parameter and some example fields, but doesn't explain what happens after creation, what the response looks like, or any error conditions. Given the complexity, it should do more to be truly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at only 50%, the description adds meaningful value by explicitly mentioning 'companyRequest object with various properties like addressOne, emailOne, name, and tags'. This provides semantic context about what kind of data is expected, though it doesn't fully compensate for the 50% coverage gap. The mention of 'options' parameter is omitted, which is a minor gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Create a new company' which is a clear verb+resource combination, but it's somewhat vague about what 'company' means in this context and doesn't differentiate from sibling tools like 'updateCompany' or 'deleteCompany'. The second sentence 'This tool allows you to create a company' is tautological and adds no value.

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 provided about when to use this tool versus alternatives like 'updateCompany' or 'deleteCompany'. The description doesn't mention prerequisites, dependencies, or any contextual factors that would help an agent decide when this is the appropriate tool to invoke.

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/Vizioz/Teamwork-MCP'

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