Skip to main content
Glama
webimpianteam

Bayarcash MCP Server

get_transaction_by_order

Retrieve transaction details using an order number to verify payment status and access specific payment information within the Bayarcash payment system.

Instructions

Get transaction details by order number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_numberYesOrder number to retrieve

Implementation Reference

  • MCP tool handler for 'get_transaction_by_order': validates input schema, calls BayarcashClient.getTransactionByOrderNumber, and returns JSON response.
    case 'get_transaction_by_order': {
      // Validate input
      const validation = validateInput(orderNumberSchema, args);
      if (!validation.success) {
        throw new McpError(ErrorCode.InvalidParams, `Validation error: ${validation.error}`);
      }
    
      const result = await bayarcash.getTransactionByOrderNumber(validation.data.order_number);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • src/index.ts:130-142 (registration)
    Tool registration in ListTools handler, including name, description, and input schema for 'get_transaction_by_order'.
    {
      name: 'get_transaction_by_order',
      description: 'Get transaction details by order number',
      inputSchema: {
        type: 'object',
        properties: {
          order_number: {
            type: 'string',
            description: 'Order number to retrieve'
          }
        },
        required: ['order_number']
      }
  • Zod schema for validating order_number input used in get_transaction_by_order handler.
    export const orderNumberSchema = z.object({
      order_number: z.string().min(1, 'Order number is required')
    });
  • Smithery-style MCP tool definition including schema, handler for 'get_transaction_by_order'.
    // Tool: Get transaction by order
    server.tool(
      'get_transaction_by_order',
      'Get transaction details by order number',
      {
        order_number: z.string().describe('Order number to retrieve')
      },
      async ({ order_number }) => {
        const result = await bayarcash.getTransactionByOrderNumber(order_number);
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
        };
      }
  • Core API client method that performs HTTP GET to retrieve transaction by order number from Bayarcash API.
    async getTransactionByOrderNumber(orderNumber: string): Promise<Transaction> {
      try {
        const response = await this.axiosInstance.get(`/transactions/order/${orderNumber}`);
        return response.data.data || response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), but doesn't mention whether it requires authentication, has rate limits, returns errors for invalid order numbers, or provides pagination details. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 function. It's front-loaded with the core purpose and contains no unnecessary words or redundant information. Every part of the sentence earns its place.

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 the lack of annotations and output schema, the description is incomplete for a retrieval tool. It doesn't explain what transaction details are returned, error handling, or authentication requirements. While the purpose is clear, the behavioral and output context is insufficient for an agent to use it confidently without additional assumptions.

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

Parameters3/5

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

The schema description coverage is 100%, with the single parameter 'order_number' fully documented in the schema. The description adds no additional parameter details beyond what's in the schema (e.g., format examples, constraints). According to the rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 tool's purpose with a specific verb ('Get') and resource ('transaction details'), and specifies the lookup method ('by order number'). It distinguishes from the sibling 'get_transaction' (which likely uses a different identifier) and 'list_transactions' (which retrieves multiple records). However, it doesn't explicitly differentiate from all siblings, so it's not a perfect 5.

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 when to choose this over 'get_transaction' (presumably by transaction ID) or 'list_transactions', nor does it specify prerequisites or exclusions. The agent must infer usage from the name and context alone.

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/webimpianteam/bayarcash-mcp-server'

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