Skip to main content
CodeCall exposes four meta-tools that replace direct tool access. This page documents the complete API for each tool with request/response schemas and examples.

codecall:search

Search for tools by natural language query using semantic embeddings.

Request Schema

Response Schema

Examples

Response Example

Search Strategy

CodeCall supports two embedding strategies:

codecall:describe

Get detailed schemas and documentation for specific tools.

Request Schema

Response Schema

usageExamples returns up to 5 entries per tool. Each entry has a description and a code snippet that calls the tool via callTool(...) so the LLM can copy the pattern directly into a codecall:execute script. They are the tool’s own examples when it declares any, and nothing else. A tool without examples gets one generated example whose arguments are built only from its input schema’s properties (the required properties, the query-like or first filter property for a search, the real pagination properties for a list, the first value of an enum), or {} when none fits; an argument the schema does not declare is never shown. Values stay within the property’s enum, const, minimum/maximum and minLength/maxLength; a pattern or format is not generated, so an optional query that has one is left out and a required property that has one gets a plain placeholder string. A list tool without pagination properties gets only its required properties, and an update adds the first two non-id properties.

Example

Security Note

codecall:describe will not return information about CodeCall meta-tools themselves. Attempting to describe codecall:execute returns the tool in notFound.

codecall:execute

Execute a JavaScript (AgentScript) plan that orchestrates multiple tools.

Request Schema

Response Schema

Success:
Error Responses:
The lines an issue names (FORBIDDEN_LOOP (line 3): …) are the script’s own lines. A line that belongs to no line of the script is left out.
A failing tool call the script didn’t catch (or rethrew), through callTool() or a namespace method, including a call the access policy refused (ACCESS_DENIED). An error of the script’s own, even after it caught a tool failure, is runtime_error. The result doesn’t carry the call’s arguments: the schema keeps toolInput, deprecated and never set, since the sandbox resolves sidecar references in them before the tool sees them.

Example

AgentScript Guide

For the complete scripting API (callTool, getTool, codecallContext, __safe_parallel), error handling patterns, and best practices, see the dedicated AgentScript guide.

codecall:invoke

Direct tool invocation without JavaScript execution. Useful for simple single-tool calls.

Request Schema

Response Schema

codecall:invoke returns the standard MCP CallToolResult — the same envelope a direct tools/call produces. Errors are surfaced via isError: true plus a textual content entry; there is no separate { status, error } wrapper. Success:
Error:

Example

When to Use Invoke vs Execute


Error Codes Reference

Script Execution Errors


Error Handling

For error handling patterns including retry, fallback, and partial success strategies, see the AgentScript Guide.

Debugging Guide

Using console.log

Interpreting Error Messages

Cause: Loop ran more than maxSteps times Fix: Use pagination or filter data before looping
Cause: Script called more than maxToolCalls tools Fix: Batch operations or use __safe_parallel
Cause: Script ran longer than timeoutMs Fix: Optimize, use less data, or increase timeout
Cause: Used a blocked identifier (eval, require, etc.) Fix: Use allowed alternatives

Development Mode

For easier debugging during development:

Testing Strategy

Unit Testing AgentScript

Use the Enclave library directly to test script execution in isolation:

Integration Testing

For end-to-end tests, set up a FrontMCP app with CodeCallPlugin and invoke the meta-tools through your MCP test client:

Testing Security Rules

CI/CD Integration



AgentScript Guide

Complete scripting API, error handling, and best practices

Configuration

Configure meta-tool behavior and limits

Security Model

How scripts are validated and sandboxed

Examples & Recipes

Real-world patterns using the meta-tools