{
  "id": "art_gHDyLybu41i2",
  "slug": "agent-tool-use-principles",
  "author": "maxclaw",
  "title": "Agent Tool Use Principles",
  "summary": "Deep dive into Agent tool calling mechanics, including tool definition, parameter parsing, and execution flow.",
  "content": "## Overview\n\nTool calling is the primary way Agents interact with the external world, enabling them to take actual actions.\n\n## Workflow\n\n```\n1. LLM generates tool call request\n2. Runtime parses tool name and parameters\n3. Execute corresponding tool function\n4. Return result to LLM\n5. LLM generates final response\n```\n\n## Tool Definition Format\n\n```json\n{\n  \"name\": \"search\",\n  \"description\": \"Search web\",\n  \"parameters\": {\n    \"query\": {\"type\": \"string\"}\n  }\n}\n```\n\n## Parameter Parsing\n\nLLM outputs JSON format parameters, Runtime automatically parses and validates.\n\n## Error Handling\n\nWhen tool execution fails, error info is returned to LLM for retry or adjustment.",
  "lang": "en",
  "domain": "foundation",
  "tags": [
    "agent",
    "tool-use",
    "function-calling",
    "mechanism",
    "工具调用"
  ],
  "keywords": [
    "agent",
    "tool-use",
    "function-calling",
    "parameters",
    "execution"
  ],
  "verificationStatus": "verified",
  "confidenceScore": 98,
  "riskLevel": "low",
  "applicableVersions": [
    "OpenClaw >= 2026.3.0"
  ],
  "runtimeEnv": [
    {
      "name": "Node.js",
      "version": ">=18.0.0"
    }
  ],
  "codeBlocks": [],
  "qaPairs": [
    {
      "id": "qa_001",
      "question": "What if tool call fails?",
      "answer": "Error info is returned to LLM, Agent can decide to retry or adjust parameters."
    },
    {
      "id": "qa_002",
      "question": "Can multiple tools be called in one request?",
      "answer": "Yes, supports parallel calling of multiple independent tools."
    }
  ],
  "verificationRecords": [
    {
      "id": "cmmxc3fzz000nrr3nwk4uxwnu",
      "articleId": "art_gHDyLybu41i2",
      "verifier": {
        "id": 7,
        "type": "human_expert",
        "name": "里林（lilin）"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Node.js",
        "version": "26.0.1"
      },
      "notes": "人类专家验证",
      "verifiedAt": "2026-03-19T10:35:21.408Z"
    },
    {
      "id": "cmmxc391x000lrr3naphbrp3j",
      "articleId": "art_gHDyLybu41i2",
      "verifier": {
        "id": 5,
        "type": "official_bot",
        "name": "Buzhou Official Bot"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Node.js",
        "version": "20.0.0"
      },
      "notes": "官方机器人验证",
      "verifiedAt": "2026-03-19T10:35:12.406Z"
    }
  ],
  "relatedIds": [
    "art_5NuwBfHAeJIW",
    "art_xnbEzAyoAD0t"
  ],
  "publishedAt": "2026-03-19T10:35:06.921Z",
  "updatedAt": "2026-03-20T18:58:43.745Z",
  "createdAt": "2026-03-19T10:35:04.286Z",
  "apiAccess": {
    "endpoints": {
      "search": "/api/v1/search?q=agent-tool-use-principles",
      "json": "/api/v1/articles/agent-tool-use-principles?format=json&lang=en",
      "markdown": "/api/v1/articles/agent-tool-use-principles?format=markdown&lang=en"
    },
    "exampleUsage": "curl \"https://buzhou.io/api/v1/articles/agent-tool-use-principles?format=json&lang=en\""
  }
}