Skip to main content
Glama

get_transaction

Retrieve detailed transaction information from the Bayarcash payment gateway using a transaction ID to verify payments and monitor financial activity.

Instructions

Get transaction details by transaction ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transaction_idYesTransaction ID to retrieve

Implementation Reference

  • Primary MCP tool handler for 'get_transaction': validates input using transactionIdSchema, calls bayarcash.getTransaction, and returns JSON response
    case 'get_transaction': {
      // Validate input
      const validation = validateInput(transactionIdSchema, args);
      if (!validation.success) {
        throw new McpError(ErrorCode.InvalidParams, `Validation error: ${validation.error}`);
      }
    
      const result = await bayarcash.getTransaction(validation.data.transaction_id);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Zod schema used for validating get_transaction input (transaction_id)
    export const transactionIdSchema = z.object({
      transaction_id: z.string().min(1, 'Transaction ID is required')
    });
  • src/index.ts:116-129 (registration)
    Tool registration in ListToolsResponse including name, description, and input schema
    {
      name: 'get_transaction',
      description: 'Get transaction details by transaction ID',
      inputSchema: {
        type: 'object',
        properties: {
          transaction_id: {
            type: 'string',
            description: 'Transaction ID to retrieve'
          }
        },
        required: ['transaction_id']
      }
    },
  • Alternative MCP tool handler/registration using Smithery API (includes inline schema and handler)
    server.tool(
      'get_transaction',
      'Get transaction details by transaction ID',
      {
        transaction_id: z.string().describe('Transaction ID to retrieve')
      },
      async ({ transaction_id }) => {
        const result = await bayarcash.getTransaction(transaction_id);
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
        };
      }
    );
  • Core helper method BayarcashClient.getTransaction that performs the actual API call to retrieve transaction details
    async getTransaction(transactionId: string): Promise<Transaction> {
      try {
        const response = await this.axiosInstance.get(`/transactions/${transactionId}`);
        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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions retrieving details but doesn't specify what those details include, whether authentication is required, rate limits, error conditions, or if it's a read-only operation. This leaves significant gaps in understanding the tool's behavior.

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 with no unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

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?

For a retrieval tool with no annotations and no output schema, the description is inadequate. It doesn't explain what details are returned, potential error cases, or how it differs from sibling tools. Given the context of multiple transaction-related tools, more guidance is needed for proper tool selection.

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?

Schema description coverage is 100%, so the schema already documents the single parameter 'transaction_id'. The description adds minimal value by implying the parameter is used to retrieve details, but doesn't provide additional context like format examples or constraints beyond what's in the schema.

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 transaction ID. However, it doesn't differentiate from sibling tools like 'get_transaction_by_order' or 'list_transactions', which also retrieve transaction information through different mechanisms.

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_by_order' or 'list_transactions'. The description only states what it does, not when it's appropriate or what prerequisites might exist for its use.

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