0Pricing
MCP Academy · Ders

Parametreli Kaynak URI'leri

Değişkenleri doğrudan URI yolundan alın.

Parametreli Kaynak URI'leri, 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.

One Pattern, Many Resources

A static resource has one fixed address. A parameterized URI is a pattern that stands in for a whole family of resources at once. ✨

Placeholders in Curly Braces

You mark the variable part of a URI with a placeholder in curly braces, like users://{user_id}/profile. That brace is a slot to fill.

users://{user_id}/profile

The Template Is a Promise

A resource template tells the client: any URI matching this shape is valid. The model can plug in real values to ask for exactly what it needs.

Decorate to Register

In the Python SDK you register a template the same way as a tool: with the @mcp.resource decorator, passing the URI pattern as its argument.

@mcp.resource("users://{user_id}/profile")
def get_profile(user_id: str) -> str:
    return f"Profile for {user_id}"

Names Must Match

Every placeholder in the URI must appear as a function parameter with the same name. The SDK wires {user_id} straight into your user_id argument.

Capture More Than One

You can capture several variables in one URI. Multiple placeholders each map to their own parameter, so one pattern can pinpoint very specific data.

@mcp.resource("repos://{owner}/{name}/readme")
def readme(owner: str, name: str) -> str:
    return load_readme(owner, name)

Values Arrive as Strings

Captured pieces come in as text from the URI. If you need a number, convert it yourself inside the function before using it.

def get_page(page: str) -> str:
    n = int(page)
    return render_page(n)

One Segment Per Placeholder

By default a placeholder captures a single path segment, the text between two slashes. It stops at the next slash, so it won't swallow the rest of the path.

Templates Don't List Themselves

A plain resource shows up in the resource list. A templated resource usually does not, since there are endless possible URIs. The client reads it by filling the pattern.

Keep URIs Meaningful

Design URIs that read like clear addresses, such as weather://{city}/today. A model picks the right resource far more reliably when the path explains itself.

weather://{city}/today

Why This Matters

Parameterized URIs let one tidy function serve thousands of resources. You write the shape once, and the variable parts do the rest. 🎯

Quick Check

How does a captured URI placeholder reach your function?

Recap

You learned that parameterized URIs use curly-brace placeholders to serve a whole family of resources, each one mapped to a matching function parameter. Next: building their content. 🚀

Sıkça Sorulan Sorular

“Parametreli Kaynak URI'leri” dersi ücretsiz mi?

Evet — “Parametreli Kaynak URI'leri” 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.

“Parametreli Kaynak URI'leri” dersinde ne öğreneceğim?

Değişkenleri doğrudan URI yolundan alı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.

“Parametreli Kaynak URI'leri” 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. Parametreli Kaynak URI'leri
  2. İçeriği Okuma Anında Oluşturma
  3. Liste ve Şablonlu Kaynaklar
  4. Güncellemeleri İstemcilere Bildirme
← MCP Academy Sayfasına Dön