Skip to main content
Glama

execute_script

Destructive

Execute JavaScript scripts to batch-process Billy API operations, such as loops, aggregations, and reconciliation, with dry-run and mutation logging.

Instructions

Run a short JavaScript (ES2022, top-level await allowed) batch script against the Billy API — use for loops, aggregation and reconciliation instead of many single tool calls (e.g. void 30 entries, post 7 monthly journals, sum postings). In scope: billy (get(path,query?), post(path,body), put(path,body), del(path), request(method,path,{body,query}), fetchAll(path,resourceKey,query?,maxRecords?) [GET-only], getOrganizationId()) and console.log. Return a value or log results. Safety: every mutating HTTP call is logged server-side and the mutation log is ALWAYS returned, even if the script throws; dry_run=true simulates writes without executing them (and skips the approval prompt); in read-only mode non-GET calls are blocked; in confirm mode ONE user approval is requested upfront showing the full script. Limits: default 30s timeout, 50 API calls per run, output capped. Billy gotchas: POST/PUT bodies need singular-key wrapping ({ daybookTransaction: {...} }); Billy silently ignores undocumented query filters; use apiType as idempotency key on daybook transactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJavaScript source. `billy` and `console.log` are in scope. Top-level await allowed. Return a value or console.log results.
dry_runNoSimulate: non-GET calls are logged and return {dryRun:true} without executing (default false)
timeout_msNoScript timeout in ms (default 30000)
max_api_callsNoAPI call budget per run (default 50)
Behavior5/5

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

Annotations indicate destructiveHint=true, and the description expands with rich behavioral details: every mutating call is logged server-side, mutation log always returned even on throw, dry_run simulates writes, read-only mode blocks non-GET, confirm mode requires approval. Limits (timeout, API calls, output cap) are disclosed.

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

Conciseness4/5

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

The description is thorough but slightly long; however, it is well-structured with clear sections (purpose, scope, safety, limits, gotchas). Every sentence adds value. Minor improvement could be slightly more concise.

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

Completeness5/5

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

Given the tool's complexity (scripting, 4 params, no output schema), the description comprehensively covers return values (mutation log always returned, dry_run response), safety modes, limits, and Billy-specific gotchas. It fully enables correct usage.

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?

Schema coverage is 100%, but the description adds meaningful context beyond the schema: the 'script' parameter's available APIs, 'dry_run' simulation behavior, default timeout and max API calls. It clarifies parameter semantics without redundancy.

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?

The description clearly states the tool runs JavaScript scripts against the Billy API for batch operations, specifying the language and use cases (loops, aggregation, reconciliation). It distinguishes from sibling tools by positioning itself as an alternative to many single-tool calls.

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

Usage Guidelines5/5

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

The description explicitly says when to use this tool (for loops, aggregation, reconciliation instead of many single calls) and provides examples. It also covers safety modes (dry_run, read-only, confirm) and Billy gotchas, guiding proper usage.

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/Thourum/billy-mcp'

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