Skip to main content
Glama

get_payment_intent

Retrieve payment intent details and status using a payment intent ID. View comprehensive payment history including all transaction attempts for monitoring and verification.

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

  • The MCP tool handler for 'get_payment_intent' that validates the input using paymentIntentIdSchema, calls bayarcash.getPaymentIntent, and returns the result as JSON text content.
    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)
          }
        ]
      };
    }
  • src/index.ts:102-115 (registration)
    Registration of the 'get_payment_intent' tool in the MCP ListTools handler, defining 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']
      }
    },
  • Zod schema definition for validating the payment_intent_id input parameter used in the get_payment_intent 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_')
    });
  • Alternative Smithery-based handler and registration for 'get_payment_intent' tool with inline Zod schema, delegating to bayarcash.getPaymentIntent.
    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) }]
        };
      }
    );
  • Core helper method in BayarcashClient that performs the actual HTTP GET request to retrieve payment intent details from the Bayarcash API.
    async getPaymentIntent(paymentIntentId: string): Promise<PaymentIntentDetailResponse> {
      try {
        const response = await this.axiosInstance.get(`/payment-intents/${paymentIntentId}`);
        return 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 states the tool returns 'comprehensive payment history including all attempts', which adds some context about output behavior. However, it doesn't cover critical aspects like whether this is a read-only operation, error handling, rate limits, authentication needs, or what happens if the ID is invalid. For a tool with zero annotation coverage, this leaves significant gaps in transparency.

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 front-loads the core purpose ('Get payment intent details and status') and adds necessary detail without waste. Every part earns its place by clarifying the parameter source and return scope, making it appropriately sized and well-structured.

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 has 1 parameter with full schema coverage but no annotations and no output schema, the description is moderately complete. It explains what the tool does and hints at return content, but lacks details on behavioral traits, error cases, or output structure. For a simple retrieval tool, this is adequate but has clear gaps, especially in the absence of annotations.

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 'payment_intent_id' fully documented in the input schema. The description adds minimal value beyond the schema by noting it's 'from create_payment_intent response' and giving examples like 'pi_pGwAaq, trx_z88ymJ', but this is largely redundant with the schema's description. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 ('payment intent details and status'), and it distinguishes the scope by mentioning 'by payment intent ID' and 'comprehensive payment history including all attempts'. However, it doesn't explicitly differentiate from sibling tools like 'get_transaction' or 'get_transaction_by_order', which might also retrieve payment-related data, so it falls short of a perfect score.

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 mentions the parameter comes from 'create_payment_intent response', implying a prerequisite, but doesn't state when to choose this over siblings like 'get_transaction' or 'list_transactions'. There are no explicit when/when-not instructions or named alternatives, leaving usage context vague.

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