Skip to main content
Glama
webimpianteam

Bayarcash MCP Server

get_payment_intent

Retrieve detailed payment intent information and transaction history using a payment intent ID to monitor payment status and track all payment attempts.

Instructions

Get payment intent details and status by payment intent ID. Returns comprehensive payment history including all attempts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payment_intent_idYesPayment intent ID from create_payment_intent response (e.g., pi_pGwAaq, trx_z88ymJ). This is the "id" field.

Implementation Reference

  • Handler for the 'get_payment_intent' tool in the main MCP server (index.ts). Validates the input payment_intent_id and calls the Bayarcash client to fetch details.
    case 'get_payment_intent': {
      // Validate input
      const validation = validateInput(paymentIntentIdSchema, args);
      if (!validation.success) {
        throw new McpError(ErrorCode.InvalidParams, `Validation error: ${validation.error}`);
      }
    
      const result = await bayarcash.getPaymentIntent(validation.data.payment_intent_id);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Zod schema for validating the input to get_payment_intent tool (payment_intent_id field). Used in the index.ts handler.
    // Payment intent ID schema
    export const paymentIntentIdSchema = z.object({
      payment_intent_id: z
        .string()
        .min(1, 'Payment intent ID is required')
        .regex(/^(pi_|trx_)/, 'Payment intent ID must start with pi_ or trx_')
  • src/index.ts:102-115 (registration)
    Tool registration in ListToolsRequestHandler, including name, description, and input schema.
    {
      name: 'get_payment_intent',
      description: 'Get payment intent details and status by payment intent ID. Returns comprehensive payment history including all attempts.',
      inputSchema: {
        type: 'object',
        properties: {
          payment_intent_id: {
            type: 'string',
            description: 'Payment intent ID from create_payment_intent response (e.g., pi_pGwAaq, trx_z88ymJ). This is the "id" field.'
          }
        },
        required: ['payment_intent_id']
      }
    },
  • Core implementation in BayarcashClient: Makes HTTP GET request to Bayarcash API /payment-intents/{id} to retrieve payment intent details.
    async getPaymentIntent(paymentIntentId: string): Promise<PaymentIntentDetailResponse> {
      try {
        const response = await this.axiosInstance.get(`/payment-intents/${paymentIntentId}`);
        return response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
  • Alternative handler and registration using Smithery framework in smithery.ts.
    server.tool(
      'get_payment_intent',
      'Get payment intent details and status by payment intent ID. Use this to check the current status of a payment after it has been created. Returns comprehensive payment history including all attempts (successful and unsuccessful).',
      {
        payment_intent_id: z.string().describe('Payment intent ID from create_payment_intent response (e.g., pi_pGwAaq, trx_z88ymJ). This is the "id" field returned when payment was created.')
      },
      async ({ payment_intent_id }) => {
        const result = await bayarcash.getPaymentIntent(payment_intent_id);
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
        };
      }
    );
Behavior3/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. It discloses that the tool returns 'comprehensive payment history including all attempts', which adds behavioral context beyond a simple read operation. However, it lacks details on error handling, rate limits, authentication needs, or response format, leaving gaps for a tool with no annotation coverage.

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 front-loaded with the core purpose in the first sentence and adds valuable context in the second sentence without redundancy. Both sentences earn their place by clarifying the action and the return data, making it efficient and well-structured with zero waste.

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

Completeness3/5

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

Given the tool's complexity (a read operation with one parameter) and no annotations or output schema, the description is moderately complete. It explains what the tool does and what it returns, but lacks details on behavioral aspects like error cases or response structure, which could be important for an agent to use it correctly without structured output guidance.

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 'payment_intent_id' with its type, description, and example values. The description adds no additional parameter semantics beyond what the schema provides, such as format constraints or usage tips, meeting the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Get payment intent details and status') and resource ('by payment intent ID'), distinguishing it from sibling tools like get_transaction or list_transactions which handle different payment-related queries. It explicitly mentions what information is retrieved ('comprehensive payment history including all attempts'), making the purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies usage by referencing the 'create_payment_intent response' for the ID parameter, suggesting this tool is for retrieving details after creation. However, it does not explicitly state when to use this versus alternatives like get_transaction or get_transaction_by_order, nor does it provide exclusions or prerequisites beyond the ID requirement.

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