Skip to main content
Glama

deleteCompany

Destructive

Delete a company and all its associated data from Teamwork. Requires the company ID.

Instructions

This tool allows you to delete a company, be careful with this tool as it will delete the company and all associated data. It requires the following parameters: companyId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIdYesPath parameter: companyId

Implementation Reference

  • The tool handler function that validates input, calls the service, and returns the result or error response.
    export async function handleDeleteCompany(input: any) {
      logger.info('Calling teamworkService.deleteCompany()');
      logger.info(`Company ID: ${input?.companyId}`);
      
      try {
        const companyId = input.companyId;
        
        if (!companyId) {
          throw new Error("Company ID is required");
        }
        
        const result = await teamworkService.deleteCompany(companyId);
        logger.info(`Company deleted successfully with ID: ${companyId}`);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({ success: result }, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Deleting company');
      }
    } 
  • The tool definition/schema including name, description, inputSchema (requiring companyId integer), and annotations marking it as destructive.
    export const deleteCompanyDefinition = {
      name: "deleteCompany",
      description: "This tool allows you to delete a company, be careful with this tool as it will delete the company and all associated data. It requires the following parameters: companyId.",
      inputSchema: {
        type: 'object',
        properties: {
          companyId: {
            type: 'integer',
            description: 'Path parameter: companyId'
          }
        },
        required: [
          'companyId'
        ]
      },
      annotations: {
        title: "Delete Company",
        readOnlyHint: false,
        destructiveHint: true,
        openWorldHint: false
      }
    };
  • The service layer function that performs the actual API call to delete a company via Teamwork's REST API.
    export const deleteCompany = async (companyId: number) => {
      try {
        logger.info(`Deleting company with ID ${companyId}`);
        
        const api = ensureApiClient();
        await api.delete(`companies/${companyId}.json`);
        
        logger.info(`Successfully deleted company with ID ${companyId}`);
        return true;
      } catch (error: any) {
        logger.error(`Error deleting company with ID ${companyId}: ${error.message}`);
        throw new Error(`Failed to delete company with ID ${companyId}: ${error.message}`);
      }
    };
  • Registration of the deleteCompany tool in the toolPairs array, pairing its definition with its handler function.
    { definition: deleteCompany, handler: handleDeleteCompany },
  • Registration of deleteCompany in the Companies tool group within the configuration file for permission/feature grouping.
    'Companies': ['createCompany', 'updateCompany', 'deleteCompany', 'getCompanies', 'getCompanyById']
Behavior4/5

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

Annotations already indicate destructiveHint=true, and the description adds that it deletes 'all associated data', providing useful context beyond the annotation.

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

Conciseness4/5

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

The description is a single sentence, but slightly wordy ('be careful with this tool as it will delete...'). Could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple deletion tool with no output schema and adequate annotations, the description is nearly complete. It could mention if the company must exist or error handling.

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?

Schema coverage is 100% with a description for companyId. The description repeats the parameter necessity but adds no new meaning beyond the schema.

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 action (delete) and the resource (company). It distinguishes from sibling tools like deletePerson and deleteTask, as it specifically targets companies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a warning about the irreversible nature of the deletion, but lacks explicit guidance on when to use this tool versus alternatives or conditions for safe usage.

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