import logger from '../../utils/logger.js';
import { ensureApiClient } from '../core/apiClient.js';
/**
* Get a specific company by ID from Teamwork
* @param companyId The ID of the company to retrieve
* @param params Optional query parameters for additional options
* @returns The API response containing the company
*/
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 default getCompanyById;
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