Skip to main content
Glama
crazyrabbitLTC

Brex MCP Server

get_spend_limit

Retrieve a specific spend limit by its ID to view current spending restrictions and budget allocations 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

  • Core handler logic for the 'get_spend_limit' tool: validates parameters, fetches the spend limit using BrexClient, formats response as JSON, and handles errors.
    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;
      }
    });
  • MCP tool schema definition for 'get_spend_limit', specifying input as object with required 'id' string field.
    {
      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"]
      }
    },
  • Local registration of the 'get_spend_limit' tool handler using registerToolHandler.
    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;
        }
      });
    }
  • Top-level invocation of registerGetSpendLimitById during tools registration.
    registerGetSpendLimitById(server);
  • TypeScript interface and validation function for tool input parameters.
    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) 
      };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds '(read-only)' to indicate non-destructive operation and includes an example ('{"id":"sl_123"}') that clarifies input format. However, it lacks details on permissions, rate limits, error handling, or return format, which are important for a retrieval tool.

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 highly concise and front-loaded: a single sentence states the purpose and key behavior, followed by a minimal example. Every element (read-only hint, example) adds value without redundancy, making it efficient for an agent to parse.

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

Completeness3/5

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

Given no annotations, 1 parameter with low schema coverage, and no output schema, the description is minimally adequate. It covers the basic operation and input format but lacks details on output structure, error cases, or integration with sibling tools, leaving gaps for a retrieval tool in a financial context.

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

Parameters4/5

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

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It adds meaning by specifying that the 'id' parameter is for a spend limit ID and provides an example format ('sl_123'), which clarifies the expected string pattern beyond the schema's basic type definition.

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 tool's purpose: 'Get a spend limit by ID' specifies the verb ('Get') and resource ('spend limit'), and distinguishes it from sibling 'get_spend_limits' (plural) by indicating it retrieves a single item. However, it doesn't explicitly differentiate from other sibling tools like 'get_budget' or 'get_expense' that might also retrieve financial data by ID.

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. It doesn't mention sibling tools like 'get_spend_limits' (for listing all) or other financial retrieval tools, nor does it specify prerequisites or contexts for usage, leaving the agent to infer based on tool names alone.

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