Skip to main content
Glama
crazyrabbitLTC

Brex MCP Server

get_spend_limits

Retrieve and view current spend limit configurations for Brex accounts to monitor budget allocations and status.

Instructions

List spend limits (read-only). Example: {"limit":10,"status":"ACTIVE"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNo
parent_budget_idNo
statusNo
member_user_idNo

Implementation Reference

  • Executes the get_spend_limits tool: validates params, calls Brex API, returns formatted JSON response.
    registerToolHandler("get_spend_limits", async (request: ToolCallRequest) => {
      try {
        const params = validateParams(request.params.arguments);
        const client = getBrexClient();
        const apiParams: SpendLimitListParams = {
          limit: params.limit,
          cursor: params.cursor,
          parent_budget_id: params.parent_budget_id,
          status: params.status,
          member_user_id: params.member_user_id
        };
        const resp = await client.getSpendLimits(apiParams);
        const items = Array.isArray(resp.items) ? resp.items : [];
        return { content: [{ type: "text", text: JSON.stringify({ spend_limits: items, meta: { count: items.length, next_cursor: resp.next_cursor } }, null, 2) }] };
      } catch (error) {
        logError(`Error in get_spend_limits: ${error instanceof Error ? error.message : String(error)}`);
        throw error;
      }
    });
  • JSON schema for get_spend_limits tool inputs in the listTools handler response.
    {
      name: "get_spend_limits",
      description: "List spend limits (read-only). Example: {\"limit\":10,\"status\":\"ACTIVE\"}",
      inputSchema: {
        type: "object",
        properties: {
          limit: { type: "number" },
          cursor: { type: "string" },
          parent_budget_id: { type: "string" },
          status: { type: "string", enum: ["ACTIVE","ARCHIVED"] },
          member_user_id: { type: "string" }
        }
      }
    },
  • Registers the get_spend_limits tool handler using registerToolHandler.
    export function registerGetSpendLimits(_server: Server): void {
      registerToolHandler("get_spend_limits", async (request: ToolCallRequest) => {
        try {
          const params = validateParams(request.params.arguments);
          const client = getBrexClient();
          const apiParams: SpendLimitListParams = {
            limit: params.limit,
            cursor: params.cursor,
            parent_budget_id: params.parent_budget_id,
            status: params.status,
            member_user_id: params.member_user_id
          };
          const resp = await client.getSpendLimits(apiParams);
          const items = Array.isArray(resp.items) ? resp.items : [];
          return { content: [{ type: "text", text: JSON.stringify({ spend_limits: items, meta: { count: items.length, next_cursor: resp.next_cursor } }, null, 2) }] };
        } catch (error) {
          logError(`Error in get_spend_limits: ${error instanceof Error ? error.message : String(error)}`);
          throw error;
        }
      });
    }
  • Validates and parses input parameters for the get_spend_limits tool.
    function validateParams(input: unknown): GetSpendLimitsParams {
      const raw = (input || {}) as Record<string, unknown>;
      const out: GetSpendLimitsParams = {};
      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.parent_budget_id !== undefined) out.parent_budget_id = String(raw.parent_budget_id);
      if (raw.status !== undefined) out.status = String(raw.status) as SpendLimitStatus;
      if (raw.member_user_id !== undefined) out.member_user_id = String(raw.member_user_id);
      return out;
    }
  • TypeScript interface defining typed parameters for get_spend_limits.
    interface GetSpendLimitsParams {
      limit?: number;
      cursor?: string;
      parent_budget_id?: string;
      status?: SpendLimitStatus;
      member_user_id?: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'read-only' which is helpful, but doesn't mention pagination behavior (despite a 'cursor' parameter), rate limits, authentication requirements, or what happens when no parameters are provided (all 5 are optional). The example shows output structure but doesn't explain it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two sentences. The first sentence states the purpose clearly, and the second provides a concrete output example. Every word earns its place with no redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters (all optional, 0% documented), no annotations, and no output schema, the description is insufficient. It doesn't explain how parameters interact, what the default behavior is when no filters are provided, or the pagination mechanism implied by the 'cursor' parameter. The example helps but doesn't compensate for these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 5 parameters, the description provides no parameter information beyond what's implied by the example. The example shows 'limit' and 'status' in output but doesn't explain their role as input filters. Parameters like 'cursor', 'parent_budget_id', and 'member_user_id' are completely undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('spend limits'), making the purpose immediately understandable. It distinguishes from siblings like 'get_spend_limit' (singular) by implying it returns multiple items. However, it doesn't explicitly differentiate from other listing tools like 'get_budgets' or 'get_expenses' in terms of resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_spend_limit' (singular), 'get_budgets', and 'get_expenses', there's no indication of whether this is for bulk retrieval, filtering, or a specific use case. The example shows output format but doesn't help with tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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