get_budget
Retrieve detailed budget information from Brex financial platform using a specific budget ID to access spending limits, allocations, and financial data for analysis and reporting.
Instructions
Get a budget by ID (read-only). Returns the complete budget object. Example: {"budget_id":"budget_123"}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | Yes | The ID of the budget to retrieve |
Implementation Reference
- src/tools/getBudgetById.ts:27-43 (handler)Main execution handler for the 'get_budget' tool: validates input, fetches budget via BrexClient.getBudget, returns JSON response.registerToolHandler("get_budget", async (request: ToolCallRequest) => { try { const params = validateParams(request.params.arguments); const client = getBrexClient(); const budget = await client.getBudget(params.budget_id); return { content: [{ type: "text", text: JSON.stringify({ budget }, null, 2) }] }; } catch (error) { logError(`Error in get_budget: ${error instanceof Error ? error.message : String(error)}`); throw error; } });
- src/tools/getBudgetById.ts:14-24 (schema)Type definition and validation logic for get_budget input parameters.interface GetBudgetParams { budget_id: string; } function validateParams(input: unknown): GetBudgetParams { const raw = (input || {}) as Record<string, unknown>; if (!raw.budget_id) throw new Error("Missing required parameter: budget_id"); return { budget_id: String(raw.budget_id) }; }
- src/tools/index.ts:98-108 (schema)Official MCP input schema for the 'get_budget' tool in the listTools handler.{ name: "get_budget", description: "Get a budget by ID (read-only). Returns the complete budget object. Example: {\"budget_id\":\"budget_123\"}", inputSchema: { type: "object", properties: { budget_id: { type: "string", description: "The ID of the budget to retrieve" } }, required: ["budget_id"] } },
- src/tools/index.ts:64-64 (registration)Tool registration call within registerTools function.registerGetBudgetById(server);
- src/index.ts:48-48 (registration)Top-level server registration that includes get_budget tool.registerTools(server);