Skip to main content
Glama

get_budget_programs

Retrieve and list budget programs from Brex financial platform, including active and inactive programs with pagination support for comprehensive financial oversight.

Instructions

List budget programs (read-only). Returns complete budget program objects. Example: {"limit":10,"budget_program_status":"ACTIVE"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_program_statusNo
cursorNo
limitNo

Implementation Reference

  • Registers the 'get_budget_programs' tool handler. Validates input parameters, calls the Brex client to fetch budget programs, processes the response, and returns formatted JSON output.
    export function registerGetBudgetPrograms(_server: Server): void { registerToolHandler("get_budget_programs", async (request: ToolCallRequest) => { try { const params = validateParams(request.params.arguments); const client = getBrexClient(); const apiParams: BudgetProgramListParams = { limit: params.limit, cursor: params.cursor, budget_program_status: params.budget_program_status }; const resp = await client.getBudgetPrograms(apiParams); const items = Array.isArray(resp.items) ? resp.items : []; return { content: [{ type: "text", text: JSON.stringify({ budget_programs: items, meta: { count: items.length, next_cursor: resp.next_cursor || null } }, null, 2) }] }; } catch (error) { logError(`Error in get_budget_programs: ${error instanceof Error ? error.message : String(error)}`); throw error; } }); }
  • TypeScript interface defining the input parameters for the get_budget_programs tool.
    interface GetBudgetProgramsParams { limit?: number; cursor?: string; budget_program_status?: BudgetProgramStatus; }
  • Validates and parses the input parameters for the get_budget_programs tool, enforcing constraints like limit range.
    function validateParams(input: unknown): GetBudgetProgramsParams { const raw = (input || {}) as Record<string, unknown>; const out: GetBudgetProgramsParams = {}; if (raw.limit !== undefined) { const n = parseInt(String(raw.limit), 10); if (isNaN(n) || n <= 0 || n > 100) { throw new Error("Invalid limit (1..100)"); } out.limit = n; } if (raw.cursor !== undefined) { out.cursor = String(raw.cursor); } if (raw.budget_program_status !== undefined) { out.budget_program_status = String(raw.budget_program_status) as BudgetProgramStatus; } return out; }
  • Registers the get_budget_programs tool by calling registerGetBudgetPrograms during server tool setup.
    registerGetBudgetPrograms(server);
  • MCP input schema for the get_budget_programs tool, used in the listTools response.
    { name: "get_budget_programs", description: "List budget programs (read-only). Returns complete budget program objects. Example: {\"limit\":10,\"budget_program_status\":\"ACTIVE\"}", inputSchema: { type: "object", properties: { limit: { type: "number" }, cursor: { type: "string" }, budget_program_status: { type: "string", enum: ["ACTIVE","INACTIVE"] } } } },

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