Skip to content

<!-- cubic:v=fd710917-438a-4023-8608-2789c508a169 --> #1437

Description

@magnumquest39-cloud

P3: The clock tutorial returns a hard-coded timestamp, so copied example code never reports the current time. Compute now at call time instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs_src/apps/tutorial001.py, line 22:

<comment>The clock tutorial returns a hard-coded timestamp, so copied example code never reports the current time. Compute `now` at call time instead.</comment>

<file context>
@@ -0,0 +1,30 @@
+
+@apps.tool(resource_uri="ui://clock/app.html", description="The current time.")
+def get_time(ctx: Context) -> str:
+    now = "2026-06-26T12:00:00Z"
+    if not client_supports_apps(ctx):
+        return f"The time is {now}."
</file context>
Fix with cubic

Originally posted by @cubic-dev-ai in modelcontextprotocol/python-sdk#3003 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions