Skip to main content
Glama

get_credit_card_transactions

Retrieve Ramp credit card transaction data for analysis, filtering by date, amount, merchant, or other parameters to track spending and manage finances.

Instructions

Retrieve information about your Ramp credit card transactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sk_category_idNo
department_idNo
limit_idNo
location_idNo
merchant_idNo
card_idNo
statement_idNo
stateNo
user_idNo
sync_readyNo
from_dateNo
to_dateNo
synced_afterNo
min_amountNo
has_no_sync_commitsNo
max_amountNo
trip_idNo
entity_idNo
requires_memoNo
include_merchant_dataNo
order_by_amount_ascNo
order_by_amount_descNo
order_by_date_ascNo
order_by_date_descNo
startNo
page_sizeNo

Implementation Reference

  • The handler function that constructs the Ramp API URL with input parameters, authenticates using the context's accessToken, fetches transactions, and returns the JSON response or throws an error.
    handler: async (input, context) => { // Build URL with query parameters const url = new URL("https://api.ramp.com/developer/v1/transactions"); // Add query parameters if provided Object.entries(input).forEach(([key, value]) => { if (value !== undefined) { url.searchParams.append(key, String(value)); } }); // Set up request options const options = { method: "GET", headers: { accept: "application/json", authorization: `Bearer ${context.accessToken}`, }, }; // Make the API request const response = await fetch(url.toString(), options); if (!response.ok) { const errorText = await response.text(); throw new Error( `HTTP error! status: ${response.status} - ${errorText}` ); } const data = await response.json(); return data; },
  • Zod input schema defining optional parameters for filtering and paginating Ramp credit card transactions, such as dates, amounts, IDs, and sorting options.
    inputSchema: { sk_category_id: z.string().optional(), department_id: z.string().uuid().optional(), limit_id: z.string().uuid().optional(), location_id: z.string().uuid().optional(), merchant_id: z.string().uuid().optional(), card_id: z.string().uuid().optional(), statement_id: z.string().uuid().optional(), state: z.string().optional(), user_id: z.string().uuid().optional(), sync_ready: z.boolean().optional(), from_date: z.string().datetime().optional(), to_date: z.string().datetime().optional(), synced_after: z.string().datetime().optional(), min_amount: z.union([z.string(), z.number()]).optional(), has_no_sync_commits: z.boolean().optional(), max_amount: z.union([z.string(), z.number()]).optional(), trip_id: z.string().uuid().optional(), entity_id: z.string().uuid().optional(), requires_memo: z.boolean().optional(), include_merchant_data: z.boolean().optional(), order_by_amount_asc: z.boolean().optional(), order_by_amount_desc: z.boolean().optional(), order_by_date_asc: z.boolean().optional(), order_by_date_desc: z.boolean().optional(), start: z.string().optional(), page_size: z.number().optional() },
  • src/index.ts:48-53 (registration)
    Registration of the tool with the MCP server using server.tool(), providing name, description, inputSchema, and handler from the context-enhanced tool instance.
    server.tool( transactionsTool.name, transactionsTool.description, transactionsTool.inputSchema, transactionsTool.handler );
  • src/index.ts:44-44 (registration)
    Enhances the tool with Ramp context (accessToken) using withContext before registration.
    const transactionsTool = GET_CREDIT_CARD_TRANSACTIONS_TOOL.withContext(rampContext);
  • Type definition for the RampContext used by the tool, extending ToolContext with accessToken.
    export interface RampContext extends ToolContext { accessToken: string; }

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/dragonkhoi/ramp-mcp'

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