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:| Strategy | Description | Best For |
|---|---|---|
tfidf | TF-IDF text matching (default) | Fast, no model loading, works offline |
ml | Semantic embeddings via VectoriaDB | Better relevance, requires model |
codecall:describe
Get detailed schemas and documentation for specific tools.Request Schema
Response Schema
examples 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:execute
Execute a JavaScript (AgentScript) plan that orchestrates multiple tools.Request Schema
Response Schema
Success:Syntax Error
Syntax Error
Validation Error (AST)
Validation Error (AST)
Runtime Error
Runtime Error
Tool Error
Tool Error
Timeout
Timeout
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
Success:Example
When to Use Invoke vs Execute
Use codecall:invoke | Use codecall:execute |
|---|---|
| Single tool call | Multiple tool calls |
| No data transformation needed | Filter/join/transform results |
| Latency-sensitive (no VM overhead) | Complex orchestration logic |
| Simple CRUD operations | Conditional workflows |
Error Codes Reference
Script Execution Errors
| Code | Status | Description | Recovery |
|---|---|---|---|
SYNTAX_ERROR | syntax_error | JavaScript syntax error | Fix syntax at indicated location |
VALIDATION_ERROR | illegal_access | AST validation failed | Remove blocked construct |
SELF_REFERENCE_BLOCKED | illegal_access | Tried to call codecall:* tool | Use regular tools only |
TOOL_NOT_FOUND | tool_error | Tool doesn’t exist | Check tool name spelling |
ACCESS_DENIED | tool_error | Tool not in allowedTools | Add to allowlist |
EXECUTION_ERROR | runtime_error | Runtime error in script | Debug script logic |
TIMEOUT | timeout | Exceeded time limit | Optimize or increase timeout |
TOOL_EXECUTION_ERROR | tool_error | Tool threw an error | Check tool input |
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
Maximum iteration limit exceeded
Maximum iteration limit exceeded
Cause: Loop ran more than
maxIterations times
Fix: Use pagination or filter data before loopingMaximum tool call limit exceeded
Maximum tool call limit exceeded
Cause: Script called more than
maxToolCalls tools
Fix: Batch operations or use __safe_parallelScript execution timed out
Script execution timed out
Cause: Script ran longer than
timeoutMs
Fix: Optimize, use less data, or increase timeoutIdentifier 'X' is not allowed
Identifier 'X' is not allowed
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
Related
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