Skip to main content
Glama
Cresium

Cresium MCP Server

Official
by Cresium

confirm_transaction

Confirm a previewed transaction to move it from PREVIEW to PENDING status for processing, enabling secure financial operations management through the Cresium Partner API.

Instructions

Confirm a previewed transaction, moving it from PREVIEW to PENDING status for processing. Only works on transactions in PREVIEW status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTransaction ID to confirm

Implementation Reference

  • Tool definition/schema for confirm_transaction, including name, description, and input schema requiring an id parameter
    {
      name: "confirm_transaction",
      description:
        "Confirm a previewed transaction, moving it from PREVIEW to PENDING status for processing. Only works on transactions in PREVIEW status.",
      inputSchema: {
        type: "object" as const,
        properties: {
          id: {
            type: "number",
            description: "Transaction ID to confirm",
          },
        },
        required: ["id"],
      },
    },
  • Handler implementation for confirm_transaction that makes a PUT request to /v3/transaction/confirm/{id} to confirm a previewed transaction
    case "confirm_transaction":
      result = await this.request(
        "PUT",
        `/v3/transaction/confirm/${args.id}`
      );
      break;
  • src/index.ts:402-563 (registration)
    handleToolCall method that routes tool requests to their respective handlers via switch statement, including the confirm_transaction case
    private async handleToolCall(request: {
      params: { name: string; arguments?: Record<string, unknown> };
    }) {
      const { name, arguments: args = {} } = request.params;
    
      try {
        let result: unknown;
    
        switch (name) {
          case "health_check":
            result = await this.request(
              "GET",
              "/v3/health/",
              undefined,
              undefined,
              false
            );
            break;
    
          case "get_balance":
            result = await this.request("GET", "/v3/balance/wallets");
            break;
    
          case "search_transactions": {
            const query: Record<string, unknown> = {};
            const fields = [
              "fromDate",
              "toDate",
              "externalId",
              "nameAmountFilter",
              "cursor",
              "pageSize",
              "field",
              "order",
              "sendingFromDate",
              "sendingToDate",
              "scheduledTransactions",
            ];
            for (const f of fields) {
              if (args[f] !== undefined) query[f] = args[f];
            }
            const arrayFields = [
              "types",
              "tags",
              "states",
              "depositAddressIds",
            ];
            for (const f of arrayFields) {
              if (Array.isArray(args[f])) {
                query[`${f}[]`] = args[f];
              }
            }
            result = await this.request(
              "GET",
              "/v3/transaction/search",
              undefined,
              query
            );
            break;
          }
    
          case "get_transaction":
            result = await this.request(
              "GET",
              `/v3/transaction/${args.id}`
            );
            break;
    
          case "lookup_bank_address":
            result = await this.request(
              "GET",
              `/v3/bank-address/${args.value}`,
              undefined,
              undefined,
              false
            );
            break;
    
          case "create_transfer_preview": {
            const body: Record<string, unknown> = {
              toId: args.toId,
              amount: args.amount,
              currencyCode: args.currencyCode,
            };
            if (args.tag) body.tag = args.tag;
            if (args.sendingDate) body.sendingDate = args.sendingDate;
            if (args.description) body.description = args.description;
            result = await this.request(
              "POST",
              "/v3/transaction/preview",
              body
            );
            break;
          }
    
          case "confirm_transaction":
            result = await this.request(
              "PUT",
              `/v3/transaction/confirm/${args.id}`
            );
            break;
    
          case "create_signature_request":
            result = await this.request(
              "POST",
              `/v3/signature-request/${args.type}`,
              { id: args.id }
            );
            break;
    
          case "create_payments":
            result = await this.request(
              "POST",
              "/v3/payment/",
              args.payments
            );
            break;
    
          case "create_invoices":
            result = await this.request(
              "POST",
              "/v3/invoice/",
              args.invoices
            );
            break;
    
          case "list_payments":
            result = await this.request("POST", "/v3/payment/", []);
            break;
    
          case "list_invoices":
            result = await this.request("POST", "/v3/invoice/", []);
            break;
    
          default:
            return {
              content: [
                { type: "text" as const, text: `Unknown tool: ${name}` },
              ],
              isError: true,
            };
        }
    
        return {
          content: [
            { type: "text" as const, text: this.formatResponse(result) },
          ],
        };
      } catch (error: unknown) {
        const message =
          axios.isAxiosError(error) && error.response
            ? `API error ${error.response.status}: ${JSON.stringify(error.response.data)}`
            : error instanceof Error
              ? error.message
              : String(error);
    
        return {
          content: [{ type: "text" as const, text: message }],
          isError: true,
        };
      }
    }
  • Request helper method that signs and executes API calls with authentication headers, used by confirm_transaction to make the actual API request
    private async request(
      method: "GET" | "POST" | "PUT" | "DELETE",
      path: string,
      body?: unknown,
      queryParams?: Record<string, unknown>,
      includeCompanyId = true
    ): Promise<unknown> {
      const bodyStr = body ? JSON.stringify(body) : "";
      const { timestamp, signature } = this.sign(method, path, bodyStr);
    
      const headers: Record<string, string> = {
        "x-api-key": this.apiKey,
        "x-timestamp": timestamp,
        "x-signature": signature,
        "Content-Type": "application/json",
      };
    
      if (includeCompanyId) {
        headers["x-company-id"] = this.companyId;
      }
    
      const response = await this.client.request({
        method,
        url: path,
        data: body,
        params: queryParams,
        headers,
      });
    
      return response.data;
    }
Behavior3/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 clearly indicates this is a mutation tool (status change) and specifies the prerequisite condition (PREVIEW status). However, it doesn't mention potential side effects, error conditions, permissions needed, or what happens after PENDING status.

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 perfectly concise with two sentences that each earn their place: the first states the core action and outcome, the second provides critical usage constraint. No wasted words, front-loaded with essential information.

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

Completeness4/5

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

For a single-parameter mutation tool with no annotations and no output schema, the description provides good coverage of purpose, usage constraints, and behavioral context. The main gap is lack of information about what the tool returns or what happens after confirmation, but given the simplicity of the operation, this is a minor omission.

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 'id' parameter adequately. The description doesn't add any additional parameter semantics beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('confirm'), target resource ('a previewed transaction'), and outcome ('moving it from PREVIEW to PENDING status'). It distinguishes this from sibling tools like 'create_transfer_preview' or 'get_transaction' by focusing on status transition rather than creation or retrieval.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('Only works on transactions in PREVIEW status'), providing clear context and exclusion criteria. It implies alternatives by specifying the required status, though it doesn't name specific sibling tools for other statuses.

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/Cresium/cresium-mcp-server'

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