This page covers all configuration options for the CodeCall plugin, from quick presets to fine-grained control.
Plugin Initialization
Tool Visibility Modes
Control which tools appear inlist_tools vs. CodeCall.
codecall_only (Recommended)
Default mode. Hides all tools from list_tools, exposes via CodeCall.
Best for: Large toolsets (20+), OpenAPI adapters, clean client experience.
codecall_opt_in
Tools must explicitly opt into CodeCall. All tools visible in list_tools by default.
Best for: Gradual migration, mixed direct/CodeCall access.
metadata_driven
Full control via per-tool metadata. No global assumptions.
Best for: Small toolsets, fine-grained control.
Per-Tool Metadata
Control individual tool behavior with thecodecall metadata field:
Metadata by Mode
Common Patterns
Hide from list_tools, available in CodeCall
Hide from list_tools, available in CodeCall
codecall_only mode.Visible everywhere
Visible everywhere
Direct access only, no CodeCall
Direct access only, no CodeCall
CodeCall meta-tools only
CodeCall meta-tools only
codecall:search, codecall:describe, etc.Global Tool Filtering
Filter tools globally withincludeTools:
IncludeToolsFilterToolInfo:
includeTools: (tool) => !tool.annotations?.destructiveHint
(tool.metadata?.annotations is the same object). directCalls.filter receives the same object.
name is the name the tool was declared with. A tool admin:deleteUser in app crm is also reachable
as crm:admin:deleteUser, but the filter always sees admin:deleteUser; use appId to filter by app.
The filter is an access control, not only a search setting. CodeCall runs the same decision, with the
same tool object, for codecall:search, codecall:describe, callTool and getTool in
codecall:execute, the namespace bindings a script receives, and codecall:invoke. A tool the filter
excludes is absent from search, reported as not found by describe, and refused at execution.
VM Configuration
Configure the JavaScript sandbox:VM Presets
Preset Details
- locked_down
- secure
- balanced
- experimental
Reference Sidecar Configuration (Pass-by-Reference)
The Reference Sidecar handles large data transfer between scripts and tools. Instead of passing full data through the VM, large values are stored externally with reference IDs.Sidecar Presets by Security Level
How Pass-by-Reference Works
Benefits:- Scripts don’t need to handle large data in memory
- VM stays lightweight and secure
- Tool results can exceed VM memory limits
- Reference IDs are opaque strings (no data leakage)
Embedding Configuration
Configure how tools are indexed for search:Strategy Comparison
TF-IDF Configuration
- Tool name (tokenized:
users:list→users,list) - Description (weighted 3x)
- Key terms from description (4+ characters, no stop words)
ML Configuration
ML strategy uses VectoriaDB internally. The model (~22MB) is downloaded on first use and cached locally.
Direct Invocation
Configure thecodecall:invoke meta-tool for direct tool calls without VM overhead:
allowedTools entry matches a tool’s own name (users:getById) or its qualified
<appId>:<name> (my-app:users:getById). List the qualified name to allow the tool from one app
only; a bare name allows that tool in every app that declares it. Anything not listed is refused.
allowedTools and filter only narrow what the base policy (enabledInCodeCall, includeTools,
the blocked namespaces) already allows; listing a tool the base policy withholds does not make it
callable. filter receives the same object as includeTools.
When to Use Direct Invoke
Performance Comparison
Error Response Format
A refused call returns a standardCallToolResult. The message is the same whether the tool is
withheld or does not exist, so codecall:invoke does not reveal which tools the policy hides:
Security Considerations
- allowedTools: Always specify an explicit allowlist in production
- No script execution: Direct calls cannot run arbitrary code
- Same tool access rules:
codecall:invokefirst applies the policycodecall:executeuses (enabledInCodeCall,includeTools, blocked namespaces);directCallsonly narrows it - Audit logging: Direct calls are logged the same as scripted calls
Complete Configuration Example
Migration Guide
From Direct Tools to CodeCall
1
Add CodeCallPlugin
2
Mark Tools for CodeCall
3
Test Both Access Methods
Verify tools work via both direct calls and CodeCall.
4
Switch to codecall_only
5
Remove Direct Visibility
Related
Security Model
Security implications of configuration choices
Production & Scaling
Performance tuning and monitoring
AgentScript Guide
Scripting language reference and best practices
API Reference
Complete meta-tool schemas and examples