Skip to main content
Glama

RS.ge Waybill MCP Server

lookup-tin.tsโ€ข1.75 kB
/** * MCP Tool: Lookup Company Name from TIN * * Allows Claude to lookup company names by TIN */ import { z } from 'zod'; import type { RsWaybillSoapClient } from '../services/soap-client.js'; import { getLogger } from '../utils/logger.js'; import { formatErrorForUser } from '../utils/error-handler.js'; /** * Input schema for lookup_tin tool */ export const LookupTinInputSchema = z.object({ tin: z.string() .min(9) .max(11) .describe('Tax identification number (TIN) to lookup'), }); export type LookupTinInput = z.infer<typeof LookupTinInputSchema>; /** * Tool definition for MCP server */ export const lookupTinTool = { name: 'lookup_tin', description: 'Look up a company or person name from their TIN (Tax Identification Number) ' + 'in the RS.ge system.', inputSchema: { type: 'object' as const, properties: { tin: { type: 'string', description: 'Tax identification number (TIN) - 9 to 11 digits', minLength: 9, maxLength: 11, }, }, required: ['tin'], }, }; /** * Execute lookup_tin tool */ export async function executeLookupTin( client: RsWaybillSoapClient, input: unknown ): Promise<string> { const logger = getLogger(); try { // Validate input const validated = LookupTinInputSchema.parse(input); logger.info('Looking up TIN', { tin: validated.tin }); // Call SOAP API const name = await client.getNameFromTin(validated.tin); if (!name || name.trim() === '') { return `No company or person found for TIN: ${validated.tin}`; } return `TIN ${validated.tin}: ${name}`; } catch (error) { logger.error('Error in lookup_tin tool', { error }); return formatErrorForUser(error); } }

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/BorisSolomonia/MCPWaybill'

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