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 examples per tool. User-provided examples from the @Tool decorator take priority, with smart-generated examples filling remaining slots based on tool intent (create, list, get, update, delete, search).

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:

Example

AgentScript API

Inside codecall:execute scripts, these functions are available:

callTool(name, input, options?)

Call a tool and get the result.
Options:

getTool(name)

Get metadata about a tool (name, description, schemas).

codecallContext

Read-only context object passed in the request.

console (if enabled)

Standard console methods, captured in response logs.
Console is only available if vm.allowConsole: true in plugin config. Logs are returned in the logs array of the response.

__safe_parallel(fns, options?)

Execute multiple async operations in parallel with controlled concurrency.
Options: Limits: Error Handling:
Use Cases:

codecall:invoke

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

Request Schema

Response Schema

Success:
Error:

Example

When to Use Invoke vs Execute


Error Codes Reference

Script Execution Errors

Worker Pool Errors (when adapter=‘worker_threads’)


Error Handling Patterns

Basic Pattern: throwOnError

Retry Pattern

Fallback Pattern

Partial Success Pattern


Debugging Guide

Using console.log

Interpreting Error Messages

Cause: Loop ran more than maxIterations 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

Integration Testing with Mock Tools

Testing Security Rules

CI/CD Integration


Rate Limiting

CodeCall meta-tools respect FrontMCP’s rate limiting:

AgentScript Guide

Learn the AgentScript language in depth

Configuration

Configure meta-tool behavior and limits