Skip to content
Snow leopard edited this page Jul 16, 2026 · 1 revision

Tools

The Complete Tool System Reference

完整的工具系统参考


CogitoAgent ships with over 160 built-in tools organized into 28 categories. This page provides a comprehensive reference of all available tools, their usage, and the tool invocation mechanism.

CogitoAgent 内置了 160 多个工具,分为 28 个类别。本页提供了所有可用工具的完整参考、使用方法以及工具调用机制。


Tool Invocation | 工具调用

Tools are invoked using the [TOOL] syntax in the agent's responses. The system automatically parses, executes, and returns results.

工具在 Agent 的响应中使用 [TOOL] 语法调用。系统会自动解析、执行并返回结果。

Syntax | 语法

[TOOL] toolName("argument1", "argument2") [/TOOL]

Examples | 示例

[TOOL] ls(".") [/TOOL]
[TOOL] read("src/agent/Agent.ts") [/TOOL]
[TOOL] search("latest TypeScript features") [/TOOL]
[TOOL] runPython("print('Hello World!')") [/TOOL]

Tool Call Flow | 工具调用流程

flowchart LR
    subgraph LLM["LLM Response"]
        RESP["[TOOL] ls('.') [/TOOL]"]
    end

    subgraph PARSE["Parser"]
        P["parseAllToolCalls()"]
        EXTRACT["Extract: tool='ls', args=['.']"]
    end

    subgraph REG["Registry"]
        LOOKUP["TOOL_REGISTRY['ls']"]
        META["fn, argCount, category"]
    end

    subgraph EXEC["Execute"]
        EXECFN["ls('.') → result"]
        SAND["Sandbox (if applicable)"]
        STATS["recordToolCall()"]
        TRACE["traceToolExec()"]
    end

    subgraph RESULT["Result"]
        OUT["{ success: true, data: [...] }"]
    end

    RESP --> P
    P --> EXTRACT
    EXTRACT --> LOOKUP
    LOOKUP --> META
    META --> EXECFN
    EXECFN --> SAND
    EXECFN --> STATS
    EXECFN --> TRACE
    EXECFN --> OUT

    classDef llm fill:#1a2332,stroke:#a78bfa,color:#a78bfa
    classDef parse fill:#1a2332,stroke:#fbbf24,color:#fbbf24
    classDef reg fill:#1a2332,stroke:#fbbf24,color:#fbbf24
    classDef exec fill:#1a2332,stroke:#38bdf8,color:#38bdf8
    classDef result fill:#1a2332,stroke:#5eead4,color:#5eead4

    class RESP llm
    class P,EXTRACT parse
    class LOOKUP,META reg
    class EXECFN,SAND,STATS,TRACE exec
    class OUT result
Loading

Tool Categories Overview | 工具分类概览

flowchart LR
    subgraph CORE["Core Tools | 核心工具"]
        FILE["File Operations<br/>文件操作"]
        PATH["Path Utilities<br/>路径工具"]
        WEB["Web Tools<br/>网络工具"]
        SYSTEM["System Tools<br/>系统工具"]
    end

    subgraph EXEC["Execution | 执行"]
        CODE["Code Execution<br/>代码执行"]
        SANDBOX["Security Sandbox<br/>安全沙箱"]
        BROWSER["Browser Automation<br/>浏览器自动化"]
        GIT["Git Operations<br/>Git 操作"]
    end

    subgraph DATA["Data | 数据"]
        DB["Database<br/>数据库"]
        DATA_PROC["Data Processing<br/>数据处理"]
        TASK["Task Management<br/>任务管理"]
        MEMORY["Memory System<br/>记忆系统"]
        SCHED["Scheduler<br/>定时任务"]
    end

    subgraph COMM["Communication | 通信"]
        EMAIL["Email<br/>邮件"]
        WECHAT["WeChat<br/>微信"]
        CLUSTER["Agent Cluster<br/>智能体集群"]
    end

    subgraph MON["Monitoring | 监控"]
        MONITOR["System Monitor<br/>系统监控"]
        STATS["Statistics<br/>统计"]
    end

    subgraph AI["AI Tools | AI 工具"]
        OCR["OCR<br/>图像文字识别"]
        VISION["Vision Analysis<br/>视觉分析"]
        OFFICE["Office Documents<br/>Office 文档"]
    end

    subgraph PROF["Professional | 专业"]
        GIS["GIS<br/>地理信息"]
        BIO["Life Sciences<br/>生命科学"]
        MED["Medicine<br/>医学"]
        CHEM["Chemistry<br/>化学"]
        FIN["Finance<br/>金融"]
        MATH["Math & Stats<br/>数学统计"]
    end

    classDef core fill:#1a2332,stroke:#5eead4,color:#5eead4
    classDef exec fill:#1a2332,stroke:#38bdf8,color:#38bdf8
    classDef data fill:#1a2332,stroke:#fbbf24,color:#fbbf24
    classDef comm fill:#1a2332,stroke:#a78bfa,color:#a78bfa
    classDef mon fill:#1a2332,stroke:#94a3b8,color:#94a3b8
    classDef ai fill:#1a2332,stroke:#f472b6,color:#f472b6
    classDef prof fill:#1a2332,stroke:#f59e0b,color:#f59e0b

    class FILE,PATH,WEB,SYSTEM core
    class CODE,SANDBOX,BROWSER,GIT exec
    class DB,DATA_PROC,TASK,MEMORY,SCHED data
    class EMAIL,WECHAT,CLUSTER comm
    class MONITOR,STATS mon
    class OCR,VISION,OFFICE ai
    class GIS,BIO,MED,CHEM,FIN,MATH prof
Loading

Tool Categories by Module | 按模块分类的工具

File Operations | 文件操作 (file.ts)

Tool Parameters Description 说明
ls path List directory contents 列出目录内容
read path Read file contents 读取文件内容
copy src, dest Copy file or directory 复制文件或目录
mkdir path Create directory 创建目录
create path, content Create file with content 创建文件并写入内容
[TOOL] ls("./src") [/TOOL]
[TOOL] read("README.md") [/TOOL]
[TOOL] copy("src/main.js", "src/main.backup.js") [/TOOL]
[TOOL] mkdir("./data/output") [/TOOL]
[TOOL] create("notes.txt", "Hello World!") [/TOOL]

Path Utilities | 路径工具 (path.ts)

Tool Parameters Description 说明
getBasePath — Get the workspace base path 获取工作区基础路径
[TOOL] getBasePath() [/TOOL]

Web Tools | 网络工具 (web.ts)

Tool Parameters Description 说明
search query Search the web 联网搜索
browse url Open URL in browser 在浏览器中打开 URL
fetchPage url Fetch webpage content 抓取网页内容
[TOOL] search("latest AI news 2026") [/TOOL]
[TOOL] browse("https://github.com") [/TOOL]
[TOOL] fetchPage("https://nodejs.org/en/blog") [/TOOL]

System Operations | 系统操作 (system.ts)

Tool Parameters Description 说明
listApps — List installed applications 列出已安装的应用程序
openApp name Open an application 打开应用程序
closeApp name Close an application 关闭应用程序
[TOOL] listApps() [/TOOL]
[TOOL] openApp("Notepad") [/TOOL]
[TOOL] closeApp("Notepad") [/TOOL]

Browser Automation | 浏览器自动化 (browser.ts)

Tool Parameters Description 说明
initBrowser url Initialize browser and open URL 初始化浏览器并打开 URL
clickElement selector, description Click element 点击元素
fillField selector, value, description Fill form field 填写表单字段
selectOption selector, value Select dropdown option 选择下拉框选项
viewChanges — View page changes 查看页面变化
getPageContent — Get page content 获取页面内容
takeScreenshot name Take screenshot 截图
closeBrowser — Close browser 关闭浏览器
searchOnPage text, description Search text on page 在页面内搜索文本
findElements selector, description Find elements by selector 按选择器查找元素
searchOnEngine query, engine Search on search engine 在搜索引擎搜索
downloadFile urlOrSelector, description, options Download file 下载文件
[TOOL] initBrowser("https://example.com") [/TOOL]
[TOOL] clickElement("#login-btn", "Login button") [/TOOL]
[TOOL] fillField("#username", "admin", "Username field") [/TOOL]
[TOOL] takeScreenshot("page") [/TOOL]
[TOOL] closeBrowser() [/TOOL]

Code Execution | 代码执行 (code.ts)

Tool Parameters Description 说明
executeCode code, language Execute code (auto-detect language) 执行代码(自动检测语言)
executeFile filePath, language Execute code file 执行代码文件
runJavaScript code Execute JavaScript code 执行 JavaScript 代码
runPython code Execute Python code 执行 Python 代码
formatCode code, language Format code 格式化代码
[TOOL] runJavaScript("console.log('Hello!')") [/TOOL]
[TOOL] runPython("print(1 + 2 + 3)") [/TOOL]
[TOOL] executeFile("script.py") [/TOOL]

Security Sandbox | 安全沙箱 (sandbox.ts)

Tool Parameters Description 说明
executeCodeSandbox code, language Execute code in sandbox 在沙箱中执行代码
isSandboxEnabled — Check if sandbox is enabled 检查沙箱是否启用
[TOOL] executeCodeSandbox("console.log('sandboxed')", "javascript") [/TOOL]

Git Operations | Git 操作 (git.ts)

Tool Parameters Description 说明
gitInit cwd Initialize Git repository 初始化 Git 仓库
gitClone url, dest, cwd Clone repository 克隆仓库
gitAdd files, cwd Add files to staging 添加文件到暂存区
gitCommit message, cwd Commit changes 提交变更
gitPush remote, branch, cwd Push to remote 推送到远程
gitPull remote, branch, cwd Pull from remote 从远程拉取
gitStatus cwd Show status 查看状态
gitLog options, cwd Show commit history 查看提交历史
gitBranchCreate name, cwd Create branch 创建分支
gitBranchDelete name, cwd Delete branch 删除分支
gitBranchList cwd List branches 列出分支
gitCheckout name, cwd Switch branch 切换分支
gitCheckoutNew name, cwd Create and switch branch 创建并切换分支
gitMerge branch, cwd Merge branch 合并分支
gitDiff options, cwd Show diff 查看差异
gitRemoteAdd name, url, cwd Add remote 添加远程仓库
gitRemoteList cwd List remotes 列出远程仓库
gitConfigUser name, email, cwd Set user config 设置用户配置
gitReset options, cwd Reset changes 撤销更改
gitStash cwd Stash changes 暂存更改
gitStashPop cwd Pop stash 恢复暂存
[TOOL] gitStatus() [/TOOL]
[TOOL] gitAdd(".") [/TOOL]
[TOOL] gitCommit("feat: add new feature") [/TOOL]
[TOOL] gitPush("origin", "main") [/TOOL]

⚠️ Security Warning: gitPush, gitReset, and gitBranchDelete require user confirmation by default.

⚠️ 安全警告:gitPush、gitReset 和 gitBranchDelete 默认需要用户确认。


Task Management | 任务管理 (task.ts)

Tool Parameters Description 说明
createTask title, description, priority, parentId Create task 创建任务
getTasks filter Get tasks 获取任务列表
getTask id Get single task 获取单个任务
updateTask id, updates Update task 更新任务
deleteTask id Delete task 删除任务
completeTask id Complete task 完成任务
splitTask id, subtasks Split task into subtasks 分解任务为子任务
getTaskStats — Get task statistics 获取任务统计
clearTasks — Clear all tasks 清空所有任务
[TOOL] createTask("Write documentation", "Complete the API docs", "high") [/TOOL]
[TOOL] getTasks("pending") [/TOOL]
[TOOL] completeTask("123456") [/TOOL]

⚠️ Security Warning: clearTasks requires user confirmation by default.

⚠️ 安全警告:clearTasks 默认需要用户确认。


Memory System | 记忆系统 (memory.ts)

Tool Parameters Description 说明
addMemory content, tags, category Add memory 添加记忆
searchMemory query, limit Search memories 搜索记忆
getAllMemories category Get all memories 获取所有记忆
getMemory id Get single memory 获取单个记忆
updateMemory id, updates Update memory 更新记忆
deleteMemory id Delete memory 删除记忆
getMemoryStats — Get memory statistics 获取记忆统计
getRelatedMemories id, limit Get related memories 获取相关记忆
clearMemory — Clear all memories 清空所有记忆
[TOOL] addMemory("User prefers dark theme", ["preference", "ui"], "general") [/TOOL]
[TOOL] searchMemory("dark theme") [/TOOL]
[TOOL] getMemoryStats() [/TOOL]

⚠️ Security Warning: clearMemory requires user confirmation by default.

⚠️ 安全警告:clearMemory 默认需要用户确认。


Data Processing | 数据处理 (data.ts)

Tool Parameters Description 说明
readCSV filePath Read CSV file 读取 CSV 文件
writeCSV filePath, headers, rows Write CSV file 写入 CSV 文件
readJSON filePath Read JSON file 读取 JSON 文件
writeJSON filePath, data Write JSON file 写入 JSON 文件
csvToJSON csvPath, jsonPath Convert CSV to JSON CSV 转 JSON
jsonToCSV jsonPath, csvPath Convert JSON to CSV JSON 转 CSV
queryData filePath, query Query data 查询数据
analyzeData filePath Analyze data 分析数据
sortData filePath, column, order Sort data 排序数据
[TOOL] readCSV("data.csv") [/TOOL]
[TOOL] writeJSON("output.json", { key: "value" }) [/TOOL]
[TOOL] analyzeData("sales.csv") [/TOOL]

Database | 数据库 (db.ts)

Tool Parameters Description 说明
executeSQL sql, params Execute SQL statement 执行 SQL 语句
query table, conditions, options Query data 查询数据
insert table, data Insert data 插入数据
update table, data, conditions Update data 更新数据
deleteData table, conditions Delete data 删除数据
createTable name, columns Create table 创建表
dropTable name Drop table 删除表
getTables — Get table list 获取表列表
getTableSchema tableName Get table schema 获取表结构
executeTransaction statements Execute transaction 执行事务
closeDB — Close database 关闭数据库
[TOOL] executeSQL("SELECT * FROM tasks") [/TOOL]
[TOOL] insert("users", { name: "Alice" }) [/TOOL]
[TOOL] getTables() [/TOOL]

⚠️ Security Warning: deleteData and dropTable require user confirmation by default.

⚠️ 安全警告:deleteData 和 dropTable 默认需要用户确认。


Email | 邮件 (email.ts)

Tool Parameters Description 说明
sendEmail to, subject, body, options Send email 发送邮件
sendTextEmail to, subject, body Send plain text email 发送纯文本邮件
sendHtmlEmail to, subject, htmlBody Send HTML email 发送 HTML 邮件
sendTemplateEmail to, subject, template, data Send template email 发送模板邮件
sendEmailWithAttachments to, subject, body, attachments Send email with attachments 发送带附件的邮件
checkEmailConfig — Check email configuration 检查邮件配置
[TOOL] sendTextEmail("user@example.com", "Hello", "This is a test email") [/TOOL]
[TOOL] checkEmailConfig() [/TOOL]

System Monitoring | 系统监控 (monitor.ts)

Tool Parameters Description 说明
getCPUInfo — Get CPU information 获取 CPU 信息
getMemoryInfo — Get memory information 获取内存信息
getDiskInfo — Get disk information 获取磁盘信息
getNetworkInfo — Get network information 获取网络信息
getProcesses — Get process list 获取进程列表
getSystemInfo — Get system information 获取系统信息
getCurrentProcess — Get current process info 获取当前进程信息
getSystemLoad — Get system load 获取系统负载
monitorSystem — Monitor system 监控系统
[TOOL] getCPUInfo() [/TOOL]
[TOOL] getMemoryInfo() [/TOOL]
[TOOL] monitorSystem() [/TOOL]

Scheduler | 定时任务 (scheduler.ts)

Tool Parameters Description 说明
addScheduleTask name, cronExpr, action, params Add scheduled task 添加定时任务
getScheduleTasks — Get scheduled tasks 获取定时任务列表
getScheduleTask id Get single task 获取单个定时任务
updateScheduleTask id, updates Update task 更新定时任务
toggleScheduleTask id Enable/disable task 启用/禁用任务
removeScheduleTask id Remove task 删除定时任务
startScheduler — Start scheduler 启动调度器
stopScheduler — Stop scheduler 停止调度器
[TOOL] addScheduleTask("daily-report", "0 9 * * *", "system.check", {}) [/TOOL]
[TOOL] getScheduleTasks() [/TOOL]

⚠️ Security Warning: removeScheduleTask requires user confirmation by default.

⚠️ 安全警告:removeScheduleTask 默认需要用户确认。


OCR | 图像文字识别 (ocr.ts)

Tool Parameters Description 说明
ocr imagePath, prompt Recognize text from image 识别图片中的文字
ocrBatch images Batch OCR recognition 批量 OCR 识别
[TOOL] ocr("screenshot.png") [/TOOL]
[TOOL] ocrBatch("img1.jpg, img2.png, img3.webp") [/TOOL]

Vision Analysis | 视觉分析 (vision.ts)

Tool Parameters Description 说明
vision imagePath, prompt Analyze local image 分析本地图片
visionFromUrl imageUrl, prompt Analyze image from URL 分析网络图片 URL
[TOOL] vision("photo.jpg", "请详细描述这张图片的内容") [/TOOL]
[TOOL] visionFromUrl("https://example.com/image.jpg") [/TOOL]

Office Documents | Office 文档 (office.ts)

Tool Parameters Description 说明
createPpt options Create PowerPoint presentation 创建 PPT 演示文稿
createWord options Create Word document 创建 Word 文档
createExcel options Create Excel spreadsheet 创建 Excel 表格
readExcel filePath Read Excel file 读取 Excel 文件
[TOOL] createPpt({ outputPath: "presentation.pptx", slides: [...] }) [/TOOL]
[TOOL] createWord({ outputPath: "doc.docx", paragraphs: [...] }) [/TOOL]
[TOOL] createExcel({ outputPath: "data.xlsx", sheets: [...] }) [/TOOL]
[TOOL] readExcel("data.xlsx") [/TOOL]

GIS | 地理信息 (gis.ts)

Tool Parameters Description 说明
convertCoord lng, lat, from, to Convert coordinate system 坐标系统转换
calcDistance lng1, lat1, lng2, lat2, unit Calculate distance 计算距离
calcArea coordinates Calculate polygon area 计算多边形面积
calcCenter coordinates Calculate centroid 计算质心
pointInPolygon lng, lat, polygon Point-in-polygon test 点是否在多边形内
isInChina lng, lat Check if in China 是否在中国范围内
readGeoJSON filePath Read GeoJSON file 读取 GeoJSON 文件
queryGeoJSON filePath, filter Query GeoJSON 查询 GeoJSON
geoJSONStats filePath GeoJSON statistics GeoJSON 统计
geoJSONToCSV geojsonPath, csvPath GeoJSON to CSV GeoJSON 转 CSV
geoJSONToKML geojsonPath, kmlPath GeoJSON to KML GeoJSON 转 KML
[TOOL] convertCoord(116.397, 39.909, "wgs84", "gcj02") [/TOOL]
[TOOL] calcDistance(116.4, 39.9, 121.5, 31.2, "km") [/TOOL]
[TOOL] readGeoJSON("map.geojson") [/TOOL]

Life Sciences | 生命科学 (bio.ts)

Tool Parameters Description 说明
dnaComplement seq DNA complementary strand DNA 互补链
dnaReverseComplement seq DNA reverse complement DNA 反向互补
rnaTranscribe seq DNA to RNA transcription DNA 转录为 RNA
translate seq, readingFrame RNA to protein translation RNA 翻译为蛋白质
gcContent seq GC content calculation GC 含量计算
molecularWeight seq Protein molecular weight 蛋白质分子量
hammingDistance seq1, seq2 Hamming distance Hamming 距离
levenshteinDistance seq1, seq2 Levenshtein distance Levenshtein 编辑距离
tmEstimate seq Primer Tm estimation 引物 Tm 估算
hairpinCheck seq Hairpin structure detection 发夹结构检测
parseFASTA filePath Parse FASTA file 解析 FASTA 文件
parseFASTQ filePath Parse FASTQ file 解析 FASTQ 文件
fastaToCSV fastaPath, csvPath FASTA to CSV FASTA 转 CSV
codonUsage seq Codon usage frequency 密码子使用频率
randomSeq length, type Generate random sequence 随机序列生成
[TOOL] dnaReverseComplement("ATGCGTACG") [/TOOL]
[TOOL] translate("AUGCCUAGCUAG", 0) [/TOOL]
[TOOL] parseFASTA("genome.fasta") [/TOOL]
[TOOL] gcContent("ATGCGCTAGCTAGCTAG") [/TOOL]

Medicine | 医学 (med.ts)

Tool Parameters Description 说明
bmi weight, height BMI calculation BMI 计算
bsa weight, height, formula Body surface area 体表面积
egfr creatinine, age, gender eGFR calculation eGFR 估算
crcl creatinine, age, weight, gender Creatinine clearance 肌酐清除率
childPugh bilirubin, albumin, inr, ascites, encephalopathy Child-Pugh score Child-Pugh 分级
calculateDose weight, dosePerKg, unit Weight-based dosing 按体重计算剂量
bsaDose bsa, dosePerM2, unit BSA-based dosing 按体表面积计算剂量
infusionRate volume, time, timeUnit Infusion rate 输液速度
idealBodyWeight height, gender Ideal body weight 理想体重
convertUnit value, from, to Unit conversion 医学单位换算
temperatureConvert value, from, to Temperature conversion 温度换算
meanArterialPressure sbp, dbp Mean arterial pressure 平均动脉压
anionGap na, cl, hco3 Anion gap 阴离子间隙
correctedCalcium calcium, albumin Corrected calcium 校正钙
oxygenIndex pao2, fio2 Oxygenation index 氧合指数
parseVitalSigns filePath Parse vital signs CSV 解析生命体征 CSV
vitalsReport filePath Vital signs report 生命体征报告
[TOOL] bmi(70, 1.75) [/TOOL]
[TOOL] egfr(1.0, 45, "male") [/TOOL]
[TOOL] childPugh(2.5, 3.0, 1.8, "mild", "none") [/TOOL]
[TOOL] convertUnit(100, "mg/dL", "mmol/L") [/TOOL]

Chemistry | 化学 (chem.ts)

Tool Parameters Description 说明
elementInfo symbol Look up element information 查询元素信息
molWeight formula Calculate molecular weight 计算分子量
elementComposition formula Element composition 元素百分比组成
molarity moles, volume Molarity calculation 摩尔浓度
dilution c1, v1, c2, v2 Dilution calculation 稀释计算
phFromH h H+ to pH H+ 计算 pH
phToH ph pH to H+ pH 计算 H+
idealGasLaw P, V, n, T Ideal gas law 理想气体状态方程
gasDensity mw, T, P Gas density calculation 气体密度
[TOOL] elementInfo("Fe") [/TOOL]
[TOOL] molWeight("H2SO4") [/TOOL]
[TOOL] phFromH(1e-7) [/TOOL]
[TOOL] idealGasLaw(null, 22.4, 1, 273) [/TOOL]

Finance | 金融 (finance.ts)

Tool Parameters Description 说明
compoundInterest P, r, n, t Compound interest 复利终值
presentValue FV, r, n Present value 现值计算
futureValueAnnuity PMT, r, n Future value annuity 年金终值
npv rate, cashflows Net present value 净现值 NPV
irr cashflows Internal rate of return 内部收益率 IRR
paybackPeriod cashflows Payback period 投资回收期
roi gain, cost Return on investment 投资回报率
loanPayment principal, annualRate, months Loan payment 等额本息月供
amortizationSchedule principal, annualRate, months Amortization schedule 还款计划表
totalInterest principal, annualRate, months Total interest 总利息
movingAverage data, period Moving average 移动平均线
volatility prices Volatility 波动率
[TOOL] compoundInterest(10000, 0.05, 12, 5) [/TOOL]
[TOOL] npv(0.1, "[-10000, 3000, 4000, 5000]") [/TOOL]
[TOOL] loanPayment(100000, 0.042, 240) [/TOOL]

Mathematics & Statistics | 数学统计 (math.ts)

Tool Parameters Description 说明
describe data Descriptive statistics 描述性统计
correlation x, y Pearson correlation 皮尔逊相关系数
linearRegression x, y Linear regression 线性回归
matrixMultiply A, B Matrix multiplication 矩阵乘法
matrixDeterminant A Matrix determinant 矩阵行列式
matrixInverse A Matrix inverse 矩阵逆
solveQuadratic a, b, c Solve quadratic equation 一元二次方程
factorial n Factorial 阶乘
combination n, k Combination C(n,k) 组合数
permutation n, k Permutation P(n,k) 排列数
siConvert value, from, to SI unit conversion SI 单位换算
[TOOL] describe("[1,2,3,4,5,6,7,8,9,10]") [/TOOL]
[TOOL] correlation("[1,2,3,4,5]", "[2,4,6,8,10]") [/TOOL]
[TOOL] linearRegression("[1,2,3,4,5]", "[2,4,5,7,8]") [/TOOL]
[TOOL] solveQuadratic(1, -5, 6) [/TOOL]

Agent Cluster | 智能体集群 (cluster.ts)

Tool Parameters Description 说明
spawnAgent persona, name, instruction Spawn a sub-agent 生成子智能体
delegateTask agentId, task Delegate task to sub-agent 向子智能体委派任务
getClusterStatus — Get cluster status 获取集群状态
stopAgent agentId Stop a sub-agent 停止子智能体
stopAllAgents — Stop all agents 停止所有智能体
parallelExecute tasks Parallel execution 并行执行
getAgent agentId Get agent details 获取智能体详情
panelDiscussion topic, agentIds, moderatorInstruction Panel discussion 圆桌讨论
pipeline steps Agent pipeline 智能体流水线
voting question, agentIds, options Multi-agent voting 多智能体投票
[TOOL] spawnAgent("Critic", "Reviewer", "Review code quality") [/TOOL]
[TOOL] delegateTask("agent_1", "Please review this function") [/TOOL]
[TOOL] getClusterStatus() [/TOOL]
[TOOL] panelDiscussion("AI ethics", "[\"agent_1\", \"agent_2\"]", "") [/TOOL]

WeChat | 微信 (wechat.ts)

Tool Parameters Description 说明
loginWechat — Login via QR code 扫码登录
logoutWechat — Logout from WeChat 退出登录
sendWechatMessage to, text Send WeChat message 发送微信消息
sendWechatImage to, imagePath Send WeChat image 发送微信图片
getWechatStatus — Get WeChat status 获取微信状态
generateWechatQRCode — Generate QR code 生成二维码
[TOOL] loginWechat() [/TOOL]
[TOOL] sendWechatMessage("user123", "Hello from CogitoAgent!") [/TOOL]
[TOOL] getWechatStatus() [/TOOL]

Dangerous Operations | 危险操作

The following tools require user confirmation by default:

以下工具默认需要用户确认:

Category Tools
Git gitPush, gitReset, gitBranchDelete
Code Execution executeCode, executeFile, runJavaScript, runPython
Database deleteData, dropTable
Task clearTasks
Memory clearMemory
Scheduler removeScheduleTask

To disable confirmation, set:

要禁用确认,请设置:

COGITO_CONFIRM_DANGEROUS=false

Tool Output Limits | 工具输出限制

To prevent context overflow, tool outputs are truncated:

为防止上下文溢出,工具输出会被截断:

Tool Limit 限制
ls 5,000 chars 5,000 字符
gitLog, gitDiff 10,000 chars 10,000 字符
executeCode, runPython, runJavaScript 50,000 chars 50,000 字符
read 20,000 chars 20,000 字符
search, searchMemory 10,000 chars 10,000 字符
default 10,000 chars 10,000 字符

Next Steps | 下一步


Previous: Architecture Overview →

Next: Extensions →

上一篇: 架构设计 →

下一篇: 扩展功能 →

Clone this wiki locally