🎓 הקורס הדיגיטלי המקיף בישראל ל-Claude — לעבוד חכם יותר עם Claude
פפרומפטים.AIחיפוש
🤖

Skill Tool Use ו-Function Calling ל-Claude

שילוב כלים חיצוניים ו-APIs במודלי שפה באמצעות Function Calling לביצוע פעולות בעולם האמיתי.

tool-use-function-calling · v1.0.0💾 4KB · חינם🧩 חלק מחבילת מומחה AI לעסקים
מה זה Skill ואיך מתקינים?

Skill הוא יכולת קבועה ש-Claude טוען אוטומטית כשהיא רלוונטית לבקשה שלך — בניגוד לפרומפט רגיל שצריך להעתיק מחדש בכל שיחה. מתקינים פעם אחת (מעבירים תיקייה אל ~/.claude/skills/ או מעלים דרך הגדרות האפליקציה), ומאז הוא עובד לבד — ללא כל פעולה נוספת.

חדש ל-Claude? התחל כאן ←

⬇️ הורדת ה-Skill (4KB)

ZIP · ללא הרשמה · רישיון שימוש כלול בקובץ

📖 מה ה-Skill הזה כולל

מתי להשתמש

"Function calling", "Tool use", "AI calling APIs", "Structured tool invocation".

הוראות עבודה

1. What is Tool Use

LLM decides when to call a function/API and with what parameters. You define tools, LLM picks + calls them.

2. Common Tools

  • search (web, internal).
  • calculator.
  • database queries.
  • email/Slack send.
  • calendar booking.
  • file operations.
  • payment/transaction (with safeguards).
  • custom APIs.

3. Tool Definition (Anthropic)

tools = [
    {
        "name": "get_weather",
        "description": "Get current weather for a location.",
        "input_schema": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "string",
                    "description": "City name, e.g., 'Tel Aviv'"
                },
                "units": {
                    "type": "string",
                    "enum": ["celsius", "fahrenheit"],
                    "default": "celsius"
                }
            },
            "required": ["location"]
        }
    }
]

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    tools=tools,
    messages=[{"role": "user", "content": "Weather in Tel Aviv?"}]
)

4. Tool Execution Loop

while True:
    response = client.messages.create(...)
    
    if response.stop_reason == "tool_use":
        for block in response.content:
            if block.type == "tool_use":
                # Execute tool
                result = my_function(block.name, block.input)
                # Send result back
                messages.append(...)
    elif response.stop_reason == "end_turn":
        break

5. Parallel Tool Calls

Feature

  • LLM can call multiple tools in one turn.
  • Faster than sequential.

Example

# User asks: "Weather in Tel Aviv and Jerusalem?"
# LLM responds with 2 tool_use blocks (parallel).
# You execute both, send back both results.

6. Tool Schema Best Practices

Description

  • Clear — what the tool does.
  • When to use — guide LLM.
  • Examples — in description.

Parameters

  • Specific namescustomer_id not id.
  • Types correct.
  • Required vs Optional clear.
  • Enums for finite choices.

Example: Good

{
  "name": "send_invoice",
  "description": "Send invoice to customer via email. Use only after customer confirms purchase.",
  "input_schema": {
    "type": "object",
    "properties": {
      "customer_id": {"type": "string", "description": "Internal customer ID, e.g., 'cust_123'"},
      "amount": {"type": "number", "description": "Invoice amount in USD"},
      "due_date": {"type": "string", "format": "date", "description": "ISO date YYYY-MM-DD"}
    },
    "required": ["customer_id", "amount", "due_date"]
  }
}

7. Error Handling

Tool Errors

  • Return error info to LLM.
  • LLM can retry / handle gracefully.
tool_result = {
    "type": "tool_result",
    "tool_use_id": tool_use.id,
    "content": "Error: Customer not found",
    "is_error": True
}

8. Safety

Approval Gates

  • Destructive tools (delete, send_money) → human approval.
  • Show preview before execution.

Rate Limiting

  • Limit tool calls per task.
  • Prevent runaway loops.

Validation

  • Validate tool inputs before execution.
  • Sanitize for SQL injection, XSS.

9. Streaming with Tools

  • Stream LLM response.
  • Once tool_use detected, execute.
  • Continue stream.

10. Cost

  • Tools add tokens (description + result).
  • Each round-trip = 1 LLM call.
  • 3-tool agent task ≈ 3-5 LLM calls.

11. Common Pitfalls

Bad descriptions — LLM picks wrong tool. ❌ No safety — agent does damage. ❌ Loops — LLM keeps calling same tool. ❌ No error handling — silent failures. ❌ Over-permissive — too many tools = confusion.

12. Israel Specifics

  • Hebrew tool descriptions — work fine.
  • Israeli APIs can be tools (HiBob, monday).

13. אסיים בהמלצה.

פרומפט לדוגמה

Define tools for sales agent (lookup, send email, schedule).

Parallel tool use — when to use?

Tool description templates.


© 2026 AI Expert Pro | גרסה 1.0.0

📥 התקנה בחצי דקה

  1. 1. הורד ופתח את קובץ ה-ZIP — תקבל תיקייה בשם tool-use-function-calling.
  2. 2. ב-Claude Code: העבר את התיקייה אל ~/.claude/skills/.
    באפליקציה (Claude / Cowork): הגדרות ← Capabilities ← Skills ← העלאה.
  3. 3. בקש מ-Claude את מה שצריך בעברית — הוא יפעיל את ה-skill לבד כשזה רלוונטי.

רוצה skill כזה, אבל מותאם בדיוק לעסק שלך?

בקורס Claude לעסקים תלמד לבנות skills משלך — לתהליכים הספציפיים שלך, בעברית, בלי תלות באף אחד.

לפרטים על לעבוד חכם יותר עם Claude ←

🧩 עוד skills מחבילת מומחה AI לעסקים

📚 פרומפטים באותו תחום

קהילה