Skip to main content
Glama

agentbay_budget_check

Check your project token budget status and monitor session usage to stay within allocated limits and avoid unexpected overages.

Instructions

Check the project token budget status and your session usage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID

Implementation Reference

  • The handler function for the 'agentbay_budget_check' tool. It calls the API endpoint /api/v1/projects/{projectId}/budget, checks if a monthly token budget is set (unlimited if 0), calculates usage percentage, and returns budget status including monthly budget, tokens used, remaining tokens, reset day, and session usage.
    // Tool 34: Budget Check
    server.tool(
      'agentbay_budget_check',
      'Check the project token budget status and your session usage',
      {
        projectId: z.string().describe('Project ID'),
      },
      async ({ projectId }) => {
        const data = await apiGet(`/api/v1/projects/${projectId}/budget`);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
    
        if (data.monthlyTokenBudget === 0) {
          return { content: [{ type: 'text' as const, text: `No token budget set for this project (unlimited).` }] };
        }
        const pct = data.monthlyTokenBudget > 0 ? Math.round((data.tokensUsedThisMonth / data.monthlyTokenBudget) * 100) : 0;
        let text = `Token Budget Status:\n`;
        text += `Monthly budget: ${data.monthlyTokenBudget.toLocaleString()}\n`;
        text += `Used this month: ${data.tokensUsedThisMonth.toLocaleString()} (${pct}%)\n`;
        text += `Remaining: ${(data.monthlyTokenBudget - data.tokensUsedThisMonth).toLocaleString()}\n`;
        text += `Budget resets on day ${data.budgetResetDay} of each month\n`;
        if (data.sessionTokens !== undefined) {
          text += `\nYour session usage: ${data.sessionTokens.toLocaleString()} tokens`;
        }
        return { content: [{ type: 'text' as const, text }] };
      }
    );
  • Input schema for 'agentbay_budget_check': requires a single parameter 'projectId' (string) described as 'Project ID'.
    // Tool 34: Budget Check
    server.tool(
      'agentbay_budget_check',
      'Check the project token budget status and your session usage',
      {
        projectId: z.string().describe('Project ID'),
      },
  • src/index.ts:917-919 (registration)
    Registration of the 'agentbay_budget_check' tool using server.tool() with name 'agentbay_budget_check' and description 'Check the project token budget status and your session usage'.
    // Tool 34: Budget Check
    server.tool(
      'agentbay_budget_check',
Behavior3/5

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

The description implies a read-only operation ('check') but does not elaborate on potential side effects, error handling, or permissions. With no annotations, the description provides minimal behavioral insight beyond the basic action.

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 a single, efficient sentence with no extraneous words. Every word contributes to the purpose.

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?

The description covers the core functionality but lacks details about output format, error scenarios, or the meaning of 'budget status'. Given the tool's simplicity (one parameter, no output schema), it is minimally adequate.

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

Parameters3/5

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

Schema coverage is 100% (projectId described as 'Project ID'), but the description adds no additional meaning beyond the schema. Per guidelines, baseline 3 is appropriate.

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

Purpose5/5

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

Description clearly states the tool's action ('check') and the specific resources ('project token budget status and your session usage'), making it distinct from siblings which focus on other domains like agents, knowledge, or projects.

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?

No guidance is provided on when to use this tool versus alternatives, nor are there any conditions or prerequisites mentioned. With many sibling tools, this omission reduces clarity for agent 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/thomasjumper/agentbay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server