0Pricing
MCP Academy · درس

الأدوات: الإجراءات التي يتخذها النموذج

الدوال التي يستدعيها الذكاء الاصطناعي لتنفيذ إجراء ما.

الأدوات: الإجراءات التي يتخذها النموذج درس مجاني في MCP Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MCP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MCP Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Meet the First Primitive

MCP gives a model three building blocks. The first is the tool: a function the AI can actually run to do something in the world. 🔧

Tools Take Action

A tool is for doing, not just knowing. Sending an email, querying a database, or creating a file all belong here because each one changes or fetches live state.

The Model Decides

You expose the tool, but the model chooses when to call it. Based on the conversation, the AI picks the right tool and fills in its arguments for you.

A Tool Is Just a Function

In the Python SDK a tool is a normal function. You mark it with the @mcp.tool() decorator and the server advertises it to clients.

@mcp.tool()
def add(a: int, b: int) -> int:
    return a + b

Every Tool Needs a Name

Each tool carries a name the model uses to call it. By default the function name becomes the tool name, so add and get_weather just work.

Descriptions Guide the AI

The model reads your docstring to learn what a tool does. A clear one sentence summary makes the AI pick the right tool at the right moment.

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b

Arguments Become a Schema

Your function's parameters turn into an input schema. The model sees the names and types so it knows exactly what data to send.

Results Flow Back

Whatever your tool returns goes back to the model as context. The AI then weaves that result into its reply to the user.

Tools Can Have Side Effects

Because a tool runs real code, it can change things: write to disk, charge a card, or post a message. That power is exactly why tools sit under user control. ⚠️

Model-Controlled by Design

MCP calls tools model-controlled. The model initiates the call, while the host app can still ask the user to approve it before anything runs.

One Tool, One Job

Keep each tool focused on a single clear action. Small, well named tools are far easier for the model to choose correctly than one giant catch-all.

Quick Check

Let's lock in what makes a tool a tool.

Recap: Tools

Nice work! A tool is a model-controlled function that does something. You name it, describe it, type its arguments, and return a result the AI can use. ✅

الأسئلة الشائعة

هل درس «الأدوات: الإجراءات التي يتخذها النموذج» مجاني؟

نعم — نص درس «الأدوات: الإجراءات التي يتخذها النموذج» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MCP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MCP Academy 4 دروس في المجموع.

ماذا ستتعلم في «الأدوات: الإجراءات التي يتخذها النموذج»؟

الدوال التي يستدعيها الذكاء الاصطناعي لتنفيذ إجراء ما. تتمرن على MCP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ MCP Academy؟

لا تُشترط خبرة سابقة. MCP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «الأدوات: الإجراءات التي يتخذها النموذج»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس MCP Academy هذا؟

نعم. كل درس في MCP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. الأدوات: الإجراءات التي يتخذها النموذج
  2. الموارد: البيانات التي يقرأها النموذج
  3. التعليمات: إرشادات قابلة لإعادة الاستخدام
  4. اختيار البدائية المناسبة
← العودة إلى MCP Academy