multimodal/websites/tarko/docs/en/guide/tool/tool-call-engine.mdx
Understanding tool execution in @agent-tars/core through the MCP framework.
@agent-tars/core uses @tarko/agent for tool call execution, which provides different tool call engines:
NativeToolCallEngine: Uses model's native function callingPromptEngineeringToolCallEngine: Prompt-based tool callingStructuredOutputsToolCallEngine: Structured output parsingThe actual implementation is in multimodal/tarko/agent/src/tool-call-engine/:
Uses the model's built-in function calling capabilities:
import { AgentTARS } from '@agent-tars/core';
const agent = new AgentTARS({
model: {
provider: 'openai',
name: 'gpt-4'
}
// Uses NativeToolCallEngine by default for compatible models
});
Falls back to prompt-based tool calling for models without native support:
const agent = new AgentTARS({
model: {
provider: 'custom',
name: 'custom-model'
}
// Automatically uses PromptEngineeringToolCallEngine
});
The main configuration for tool execution is through browser control strategies:
import { AgentTARS } from '@agent-tars/core';
const agent = new AgentTARS({
browser: {
control: 'hybrid' // 'hybrid', 'dom', 'visual-grounding'
}
});
These are implemented through BrowserToolsManager and strategy pattern.
Tools are executed through the MCP framework: