Explicit Tool Calls¶
OneTool's >>> prefix gives you explicit control over tool invocation. You write the code — the agent doesn't have to guess which tool or which parameters.
Snippet Mode vs Code Mode¶
Snippet Mode¶
Jinja2 templates invoked with $name. Values are plain strings; Python syntax does not apply.
- Quotes are optional and stripped (
q=abc≡q="abc") - Param names support prefix abbreviation (
qresolves toqueryif defined) - Per-template features (e.g. pipe batch) are not snippet language features
Code Mode¶
Python executed directly against the tool namespace.
- Python syntax applies: strings must be quoted
- Short param names work:
qresolves toquery(pack proxy prefix resolution) - Keyword arguments only:
fn(key="val")notfn("val")
Trigger Hierarchy¶
| Prefix | Role |
|---|---|
>>> |
Recommended; Python REPL symbol |
__run |
Systematic short form (__(tool)) |
mcp__onetool__run |
Canonical MCP name |
__ot, __onetool |
Deprecated — kept for backward compat, use >>> instead |
Note: mcp__ot__run is NOT a valid prefix.
Invocation Styles¶
Simple Call¶
Direct function call after the prefix:
Code Fence¶
Multi-line code in a fenced block:
>>>
```python
metals = ["Gold", "Silver"]
results = {}
for metal in metals:
results[metal] = brave.search(query=f"{metal} price")
results
```
Direct MCP Call¶
For programmatic or explicit MCP invocation:
Complete Examples¶
Simple Hash Computation¶
Multi-step Computation with Variables¶
Loop with Multiple Tool Calls¶
Prompt Engineering for Tool Calls¶
Pre-Call Instructions¶
Add context before the tool call to guide the agent:
Post-Call Processing¶
Request specific formatting or analysis after the tool result:
Structured Output Requests¶
Combine tool execution with output formatting:
>>>
```python
results = {
"hash": foo(text="hello"),
"reversed": reverse(text="hello"),
"length": count_chars(text="hello")
}
results
```
Return the results as a markdown table.