Skip to main content
Glama

get_spend_limit

Retrieve spend limit details by ID to monitor budget allocations and track spending thresholds within the Brex financial platform.

Instructions

Get a spend limit by ID (read-only). Example: {"id":"sl_123"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Registers and implements the core handler logic for the 'get_spend_limit' tool. Validates input, calls BrexClient.getSpendLimit(id), formats response as JSON, handles errors.
    export function registerGetSpendLimitById(_server: Server): void { registerToolHandler("get_spend_limit", async (request: ToolCallRequest) => { try { const params = validateParams(request.params.arguments); const client = getBrexClient(); const spendLimit = await client.getSpendLimit(params.id); return { content: [{ type: "text", text: JSON.stringify({ spend_limit: spendLimit }, null, 2) }] }; } catch (error) { logError(`Error in get_spend_limit: ${error instanceof Error ? error.message : String(error)}`); throw error; } }); }
  • Defines the input schema (GetSpendLimitParams interface) and validation logic for the tool's 'id' parameter.
    interface GetSpendLimitParams { id: string; } function validateParams(input: unknown): GetSpendLimitParams { const raw = (input || {}) as Record<string, unknown>; if (!raw.id) { throw new Error("Missing required parameter: id"); } return { id: String(raw.id) }; }
  • Input schema for 'get_spend_limit' exposed in the list tools response.
    { name: "get_spend_limit", description: "Get a spend limit by ID (read-only). Example: {\"id\":\"sl_123\"}", inputSchema: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
  • Registers the get_spend_limit tool by calling its registration function during server setup.
    registerGetSpendLimitById(server);
  • Imports the tool's registration function.
    import { registerGetSpendLimitById } from "./getSpendLimitById.js";

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/crazyrabbitLTC/mcp-brex-server'

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