Skip to main content
Glama
webimpianteam

Bayarcash MCP Server

get_transaction

Retrieve detailed transaction information using a transaction ID to verify payments, track status, and manage payment records within the Bayarcash MCP Server.

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 with transactionIdSchema, calls BayarcashClient.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)
          }
        ]
      };
    }
  • Alternative MCP tool handler for 'get_transaction' using Smithery framework: defines schema inline with Zod and handler function.
    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) }]
        };
      }
    );
  • Zod schema for validating get_transaction input: requires transaction_id string.
    // Transaction ID schema
    export const transactionIdSchema = z.object({
      transaction_id: z.string().min(1, 'Transaction ID is required')
    });
  • Core BayarcashClient method implementing the API call to fetch transaction by ID.
    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);
      }
    }
  • src/index.ts:116-129 (registration)
    Tool registration metadata in ListToolsRequestHandler, 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']
      }
    },
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 states it 'gets' details, implying a read-only operation, but doesn't clarify aspects like authentication requirements, error handling (e.g., for invalid IDs), rate limits, or response format. This leaves significant gaps for a tool that likely interacts with transactional 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 redundancy. It is front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, with no wasted verbiage.

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 tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., safety, errors), output structure, or usage context relative to siblings. Given the transactional nature implied by the name and siblings, more guidance is needed to ensure proper agent invocation.

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%, with the parameter 'transaction_id' fully documented in the schema. The description adds minimal value beyond the schema by implying the ID is used to retrieve details, but doesn't provide additional context like ID format or examples. Baseline 3 is appropriate as 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 retrieves details by transaction ID. It distinguishes from siblings like 'list_transactions' (which returns multiple) and 'get_transaction_by_order' (which uses a different identifier), though it doesn't explicitly mention these distinctions.

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 like 'get_transaction_by_order' or 'list_transactions'. It lacks context about prerequisites (e.g., needing a valid transaction ID) or exclusions, leaving the agent to infer usage from the name and parameters 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