Skip to main content
Glama

get_budget_program

Retrieve budget program details using its unique identifier to access spending limits, categories, and allocation information for financial planning and tracking.

Instructions

Get a budget program by ID (read-only). Example: {"id":"bp_123"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Primary handler for the 'get_budget_program' tool: registers the tool handler, validates input parameters, fetches the budget program by ID using BrexClient, formats response as JSON, and handles errors.
    export function registerGetBudgetProgramById(_server: Server): void { registerToolHandler("get_budget_program", async (request: ToolCallRequest) => { try { const params = validateParams(request.params.arguments); const client = getBrexClient(); const program = await client.getBudgetProgram(params.id); return { content: [{ type: "text", text: JSON.stringify({ budget_program: program }, null, 2) }] }; } catch (error) { logError(`Error in get_budget_program: ${error instanceof Error ? error.message : String(error)}`); throw error; } }); }
  • TypeScript interface and validation logic for tool input parameters requiring a string 'id'.
    interface GetBudgetProgramParams { id: string; } function validateParams(input: unknown): GetBudgetProgramParams { const raw = (input || {}) as Record<string, unknown>; if (!raw.id) throw new Error("Missing required parameter: id"); return { id: String(raw.id) }; }
  • Registration of the get_budget_program tool (via registerGetBudgetProgramById) during overall tools registration in the MCP server setup.
    registerGetBudgetPrograms(server); registerGetBudgetProgramById(server);
  • JSON schema for 'get_budget_program' input exposed in the MCP 'listTools' response.
    name: "get_budget_program", description: "Get a budget program by ID (read-only). Example: {\"id\":\"bp_123\"}", inputSchema: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
  • Helper function to instantiate the BrexClient used for API calls in the tool handler.
    function getBrexClient(): BrexClient { return new BrexClient(); }

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