system_echo
Echo structured payloads with request metadata for client integration tests.
Instructions
Echo structured payloads with request metadata for client integration tests.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| tags | No | ||
| metadata | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| tags | No | ||
| metadata | No | ||
| request_id | No | ||
| client_id | No |
Implementation Reference
- src/mcp_template/modules/system.py:26-40 (handler)The main tool handler function for 'system_echo'. It accepts a message string, optional tags and metadata, and returns an EchoResult with the echoed payload plus request_id and client_id from the context.
async def system_echo( message: str, ctx: Context[Any, Any, Any], tags: list[str] | None = None, metadata: dict[str, str] | None = None, ) -> EchoResult: """Echo structured payloads with request metadata for client integration tests.""" with container.metrics.observe_tool("system_echo"): return EchoResult( message=message, tags=tags or [], metadata=metadata or {}, request_id=ctx.request_id, client_id=ctx.client_id, ) - src/mcp_template/modules/system.py:22-24 (registration)Registration of the 'system_echo' tool via the @server.tool decorator with name='system_echo', readOnlyHint, idempotentHint, and openWorldHint=False.
@server.tool( name="system_echo", annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True, openWorldHint=False), - src/mcp_template/modules/system.py:76-85 (registration)ModuleDescriptor returned by the register() function lists 'system_echo' as one of the tools this 'system' module exports.
return ModuleDescriptor( name="system", title="System", summary="Core health, metadata, and basic integration diagnostics.", tags=["core", "ops", "introspection"], maturity="stable", tools=["system_health_check", "system_echo", "system_capability_catalog"], resources=["server://build-info", "server://health", "server://instructions"], prompts=["system_triage_incident"], ) - EchoResult model (the return type of system_echo) with fields: message, tags, metadata, request_id, client_id.
class EchoResult(TemplateModel): message: str tags: list[str] = Field(default_factory=list) metadata: dict[str, str] = Field(default_factory=dict) request_id: str | None = None client_id: str | None = None - src/mcp_template/modules/__init__.py:17-22 (registration)The MODULE_REGISTRARS dictionary maps module names to register functions; 'system' maps to register_system from system.py.
MODULE_REGISTRARS: dict[str, ModuleRegistrar] = { "system": register_system, "workspace": register_workspace, "jobs": register_jobs, "design": register_design, }