Skip to main content
Glama

get_transaction_by_order

Retrieve transaction details using an order number to verify payments, track status, and manage records in 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, formats result as JSON text content.
    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)
          }
        ]
      };
    }
  • Smithery MCP tool registration and handler for 'get_transaction_by_order': inline Zod schema validation, calls BayarcashClient.getTransactionByOrderNumber, returns JSON text.
    // 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) }]
        };
      }
  • Zod schema for validating tool input: requires order_number string.
    export const orderNumberSchema = z.object({
      order_number: z.string().min(1, 'Order number is required')
    });
  • Static input schema definition advertised in ListTools response.
    {
      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']
      }
  • BayarcashClient helper method: performs API GET /transactions/order/{orderNumber} to fetch transaction by order number.
    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 full burden. It states it 'gets' details, implying a read operation, but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what happens if the order number is invalid. For a tool with zero annotation coverage, this is a significant gap.

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 with zero waste. It's front-loaded with the core purpose, making it highly concise and well-structured for quick understanding.

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, no output schema, and a simple parameter, the description is incomplete. It doesn't explain what 'transaction details' includes, potential errors, or usage context, leaving gaps for an AI agent to infer behavior. For a retrieval tool, this is minimally adequate but lacks depth.

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 parameter 'order_number' fully documented in the schema. The description adds no additional meaning beyond implying it's the key for retrieval, so it meets the baseline of 3 where the schema does the heavy lifting.

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 ('transaction details'), specifying it's by order number. It distinguishes from the sibling 'get_transaction' (which presumably uses a different identifier) and 'list_transactions' (which lists multiple). However, it doesn't explicitly mention what 'transaction details' includes, keeping it from 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?

No guidance is provided on when to use this tool versus alternatives like 'get_transaction' or 'list_transactions'. The description implies it's for retrieving a single transaction by order number, but it doesn't state prerequisites, exclusions, or compare to siblings explicitly.

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

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