convez.ai
MCP Server
zlZayn

AI-tool-calling

zlZayn/AI-tool-calling

Ver no GitHub
InicialPluginScore · de 0 a 100

Write tools with @tool, auto-discover from tools/, and call LLM two ways: direct API (Tool Calling) or wrapped as MCP servers for agents.

Instalação

$npx convez-ai zlZayn/AI-tool-calling

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 6 dias
Versão
—
Issues abertas
8
Contribuidores
1

README

A tradução para o português deste README ainda está na fila.

AI-tool-calling

English | 简体中文

Minimal tool calling framework. Tool Calling + MCP dual-mode.

Quick Start

npm install

# MCP mode (no API key needed) — use with Claude Desktop, Claude Code, etc.
# .mcp.json is ready to use out of the box.

# Tool Calling mode (needs API key)
cp config/config_example.json config/config.json
# Edit config/config.json — fill in api_key, base_url, model
npx tsx index.ts "your question"

Usage

npx tsx index.ts "What files are here"                # answer only
npx tsx index.ts --show_process "what files are here" # show thinking + tool calls
npx tsx index.ts --stream "Fibonacci 30th"            # stream output
npx tsx index.ts --list_tools                         # list tools
ParameterDescription
questionYour question
--show_processShow thinking process, tool calls, and results
--streamStream output in real-time (auto-enables --show_process)
--force_toolForce the LLM to call a tool before answering
--list_toolsList available tools and exit

Config

config/config.json is git-ignored. Copy from the example:

cp config/config_example.json config/config.json
FieldDescriptionExample
api_keyYour API keysk-xxx
base_urlAPI endpointhttps://api.deepseek.com
modelModel namedeepseek-v4-flash

Only needed for Tool Calling mode. MCP mode does not need a config file.

MCP Mode

Registers tools as MCP servers. No API key needed — MCP clients manage LLM access themselves.

.mcp.json is ready to use out of the box. Connect via any MCP-compatible client (Claude Desktop, Claude Code, etc.).

ServerToolsDescription
run-coderun_python, run_r, run_shellExecute code in sandboxed runtimes
get-env-infoget_system_info, get_cpu_info, get_memory_info, get_disk_info, get_gpu_info, get_runtime_infoFetch host environment info

Adding Tools

  1. Create tools/my_tool.ts
  2. Import registerTool from ./lib/registry.js and call it with your tool definition
  3. Add import "./my_tool.js"; to tools/index.ts

See tools/TOOL_GUIDE.md for details.

Build

npm run build   # compile to dist/
npm run start   # run compiled version
npm run dev     # watch mode with tsx

Project Structure

AI-tool-calling/
├── index.ts                        CLI entry point
├── lib/
│   └── agent.ts                    LLM agent
├── tools/
│   ├── index.ts                    barrel exports
│   ├── get_*_info.ts               environment tools
│   ├── run_*.ts                    code execution tools
│   └── lib/
│       ├── registry.ts             tool registration
│       ├── types.ts                shared types
│       ├── errors.ts               SandboxError class
│       └── env_helpers.ts          hardware queries + runtime detection
├── servers/
│   ├── get_env_info_server.ts      MCP server for env tools
│   └── run_code_server.ts          MCP server for code tools
├── tests/
│   ├── test_naming_convention.ts   file naming checks
│   ├── test_direct_tools.ts        tool handler tests
│   ├── test_mcp_servers.ts         MCP protocol tests
│   ├── TEST_GUIDE.md               testing documentation
│   └── tool_schema.json            naming convention schema
├── config/
│   ├── config.json                 (git-ignored)
│   └── config_example.json
├── package.json
└── tsconfig.json
Ver o original no GitHub

Bom para

Relacionados