01_03_mcp_core.php
INITEnvironment loaded — running: 01_03_mcp_core.php

TOOLS — Actions the server exposes for the LLM to invoke
listToolscalculate: Performs basic arithmetic operations (add, subtract, multiply, divide), summarize_with_confirmation: Summarizes text after user confirmation (elicitation) via an LLM call (sampling)
callToolcalculate: 42 × 17
result
{
    "operation": "multiply",
    "a": 42,
    "b": 17,
    "result": 714
}

callToolsummarize_with_confirmation
ELICITAuto-accepted: {"confirm":true,"style":"concise"}
SAMPLEServer requested LLM call (1 messages)
result
{
    "style": "concise",
    "summary": "Error: sampling failed."
}

RESOURCES — Read-only data the server makes available to clients
listResourcesconfig://project: Static project configuration, data://stats: Dynamic runtime statistics (changes on every read)
readResourceconfig://project
result
{
    "name": "mcp-core-demo-php",
    "version": "1.0.0",
    "features": [
        "tools",
        "resources",
        "prompts",
        "elicitation",
        "sampling"
    ]
}
readResourcedata://stats
result
{
    "uptime_seconds": 0,
    "request_count": 1,
    "timestamp": "2026-05-22T19:56:09+02:00"
}
readResourcedata://stats (second read — request_count increments)
result
{
    "uptime_seconds": 0,
    "request_count": 2,
    "timestamp": "2026-05-22T19:56:09+02:00"
}

PROMPTS — Reusable message templates with parameters
listPromptscode-review: Template for code review requests (code, language, focus)
getPromptcode-review (language: javascript, focus: readability)
[user]Review this javascript code. Focus on code clarity and maintainability. ```javascript function add(a, b) { return a + b; } ```

DONEFinished.