0Pricing
MCP Academy · Ders

Modelin Görebileceği Araç Hataları

Yapay zekânın okuyup kurtarabileceği hataları döndürün.

Modelin Görebileceği Araç Hataları, CoddyKit'te ücretsiz bir MCP Academy dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, MCP Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. MCP Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Errors Are Just More Context

When a tool fails, the AI does not crash. It simply reads your error as context and decides what to do next, just like any result.

A Good Error Is Actionable

Write the error for a reader who can act on it. City not found beats Exception, because the model can ask the user to fix the city.

Return an Error String

The simplest pattern is returning a clear message string when something is wrong, so the model reads exactly what failed.

@mcp.tool()
def get_user(uid: int) -> str:
    if uid < 1:
        return "Error: uid must be positive."

Raise to Flag a Tool Error

You can also raise a normal Python exception. FastMCP catches it and reports a tool error back to the model, not a server crash.

@mcp.tool()
def divide(a: float, b: float) -> float:
    if b == 0:
        raise ValueError("b cannot be zero")
    return a / b

isError Marks the Result

Under the hood, a failed tool call returns content with isError set true. That flag tells the client this result describes a failure.

The Model Can Recover

A readable error lets the AI retry with better input or explain the issue to the user, turning a failure into a helpful next step. 🔁

Say What and Why

Good errors name what failed and why. File missing: report.csv is far more useful to the model than a bare Not found.

Suggest a Fix

When you can, hint at the remedy inside the error. Date must be YYYY-MM-DD lets the model correct itself on the very next call.

if not iso_date:
    raise ValueError("Date must be in YYYY-MM-DD format")

Never Leak Internals

Errors reach the model and often the user, so keep secrets, raw stack traces, and connection strings out of the message you return.

Validate, Then Error Early

Check arguments first and return the error before doing real work. Failing fast keeps your tool predictable and easy to reason about.

Errors Are Part of the Contract

Treat failures as designed output. A tool that names its likely errors is as useful to the model as one that documents its success.

Quick Check

Why write tool errors as clear, readable messages?

Recap

Tool errors are context the model reads: make them clear, say what and why, suggest a fix, and never leak internals. ✅

Sıkça Sorulan Sorular

“Modelin Görebileceği Araç Hataları” dersi ücretsiz mi?

Evet — “Modelin Görebileceği Araç Hataları” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve MCP Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. MCP Academy kursu toplamda 4 dersten oluşur.

“Modelin Görebileceği Araç Hataları” dersinde ne öğreneceğim?

Yapay zekânın okuyup kurtarabileceği hataları döndürün. MCP Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

MCP Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te MCP Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“Modelin Görebileceği Araç Hataları” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu MCP Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her MCP Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Modelin Görebileceği Araç Hataları
  2. Protokol Hataları ve Araç Başarısızlıkları
  3. Çalıştırmadan Önce Girdileri Doğrulama
  4. Güvenli Şekilde Başarısız Olun, Asla Takılmayın
← MCP Academy Sayfasına Dön