rohitg00/ai-engineering-from-scratch · error · ProtocolViolation
modern result is missing resultType
Error message
modern result is missing resultType
What it means
Error "modern result is missing resultType" thrown in rohitg00/ai-engineering-from-scratch.
Source
Thrown at phases/13-tools-and-protocols/31-mcp-conformance-versioning-and-operations/code/main.py:247
allowed.update(EXTENSION_RESULT_TYPES.get(capability, set()))
return allowed
def validate_result(
result: dict[str, Any],
era: str,
capabilities: set[str] | None = None,
) -> dict[str, Any]:
if not isinstance(result, dict):
raise ProtocolViolation("result must be an object")
preserved = dict(result)
result_type = result.get("resultType")
if era == "legacy":
if result_type is None:
return {"semanticType": "complete", "wire": preserved, "inferred": True}
elif era == "modern":
if result_type is None:
raise ProtocolViolation("modern result is missing resultType")
else:
raise ValueError(f"unknown era: {era}")
allowed = allowed_result_types(capabilities or set())
if result_type not in allowed:
raise ProtocolViolation(f"unknown or unadvertised resultType: {result_type}")
return {"semanticType": result_type, "wire": preserved, "inferred": False}
def validate_method_result(method: str, result: dict[str, Any]) -> None:
result_type = result.get("resultType")
if method == "tools/list":
if result_type != "complete":
raise ProtocolViolation("tools/list must return a complete result")
tools = result.get("tools")
if not isinstance(tools, list):
raise ProtocolViolation("complete tools/list result requires a tools array")
names: set[str] = set()View on GitHub (pinned to 39ea8a1c6d)
When it happens
Trigger: Thrown at phases/13-tools-and-protocols/31-mcp-conformance-versioning-and-operations/code/main.py:247 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of rohitg00/ai-engineering-from-scratch@39ea8a1c6d (2026-08-26).
Data as JSON: /api/errors/79fb2fe311e50ab6.
Report an issue: GitHub.