Skip to main content
Glama

getCompanyById

Retrieve detailed company information by ID from Teamwork MCP. Includes options for custom fields, full profiles, and task/project stats to enhance data analysis.

Instructions

Get a specific company by ID. Retrieves detailed information about a company identified by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIdYesThe ID of the company to retrieve
fullProfileNoInclude full profile information
getStatsNoInclude stats of company tasks and projects
includeCustomFieldsNoInclude custom fields in the response

Implementation Reference

  • Registration of the getCompanyById tool handler and definition in the toolPairs array, which is used to create toolDefinitions and toolHandlersMap.
    { definition: getCompanies, handler: handleGetCompanies }, { definition: getCompanyById, handler: handleGetCompanyById },
  • Import statement for the tool's schema (definition) and handler function.
    import { getCompanyByIdDefinition as getCompanyById, handleGetCompanyById } from './companies/getCompanyById.js';
  • Re-export of the tool handler for use elsewhere.
    export { handleGetCompanyById } from './companies/getCompanyById.js';
  • Core service function that implements the logic to retrieve a specific company by ID from the Teamwork API. This is the underlying implementation likely called by the tool handler.
    export const getCompanyById = async (companyId: number, params: any = {}) => { try { logger.info(`Fetching company with ID ${companyId} from Teamwork API`); const api = ensureApiClient(); const response = await api.get(`companies/${companyId}.json`, { params }); logger.info(`Successfully retrieved company with ID ${companyId}`); return response.data; } catch (error: any) { logger.error(`Error fetching company with ID ${companyId}: ${error.message}`); throw new Error(`Failed to fetch company with ID ${companyId}: ${error.message}`); } };
  • Export of the getCompanyById service function in the services index, making it available as teamworkService.getCompanyById in tool handlers.
    export { createCompany, updateCompany, deleteCompany, getCompanies, getCompanyById };

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