Skip to main content
Glama
BorisSolomonia

RS.ge Waybill MCP Server

get_error_codes

Retrieve error codes and descriptions from the RS.ge tax system to identify and resolve waybill processing issues.

Instructions

Get all error codes and their descriptions from RS.ge system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function that executes the tool: fetches error codes via SOAP client, formats top 20 into markdown list, handles empty results and errors.
    export async function executeGetErrorCodes( client: RsWaybillSoapClient ): Promise<string> { const logger = getLogger(); try { logger.info('Getting error codes'); const codes = await client.getErrorCodes(); if (codes.length === 0) { return 'No error codes found'; } let response = `RS.ge Error Codes (${codes.length}):\n\n`; codes.slice(0, 20).forEach((code: any) => { response += `- ${code.CODE}: ${code.NAME}`; if (code.DESCRIPTION) { response += ` - ${code.DESCRIPTION}`; } response += '\n'; }); if (codes.length > 20) { response += `\n... and ${codes.length - 20} more error codes`; } return response; } catch (error) { logger.error('Error in get_error_codes tool', { error }); return formatErrorForUser(error); }
  • MCP tool definition/registration: specifies name, description, and empty input schema (no parameters required).
    export const getErrorCodesTool = { name: 'get_error_codes', description: 'Get all error codes and their descriptions from RS.ge system', inputSchema: { type: 'object' as const, properties: {}, required: [], }, };
  • src/index.ts:124-127 (registration)
    Server registration: conditionally adds getErrorCodesTool to the list of available tools returned by listTools().
    if (features.getErrorCodes) { tools.push(getWaybillTypesTool); tools.push(getErrorCodesTool); }
  • src/index.ts:170-175 (registration)
    Tool dispatch in callTool handler: routes 'get_error_codes' calls to executeGetErrorCodes if feature enabled.
    case 'get_error_codes': if (!features.getErrorCodes) { throw new Error('get_error_codes tool is disabled'); } result = await executeGetErrorCodes(soapClient); break;
  • Supporting SOAP client method: calls RS.ge 'get_error_codes' endpoint, authenticates, parses/normalizes response into array.
    async getErrorCodes(): Promise<any[]> { const response = await this.callSoap<GetErrorCodesResponse>('get_error_codes', { su: this.credentials.user, sp: this.credentials.password, }); return normalizeToArray(response.ERROR_CODES?.ERROR_CODE); }
  • Feature flag schema for enabling/disabling the get_error_codes tool.
    getErrorCodes: z.boolean().default(true),

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

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