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),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' data (implying a read operation) but doesn't mention any behavioral traits like rate limits, authentication needs, response format, or whether it returns all codes at once or supports pagination. This leaves significant gaps for a tool that fetches system data.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundant information. It's appropriately sized and front-loaded with the core action.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a data-fetching tool. It doesn't explain what the return values look like (e.g., list format, fields included), behavioral constraints, or how it fits with sibling tools, leaving the agent with insufficient context to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('all error codes and their descriptions from RS.ge system'), making the purpose unambiguous. However, it doesn't differentiate this tool from its siblings (like get_akciz_codes or get_waybills), which appear to fetch different types of codes/documents from the same system.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for fetching error codes, or how it differs from sibling tools like get_akciz_codes or lookup_tin, leaving the agent with no usage context.

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

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