Claude Skill

typed-schema-demo

Example skill — demonstrates zero-dependency JSON Schema derivation from Python dataclasses and type annotations (issue #242). Use as a reference when authoring typed handlers that should publish inputSchema / outputSchema without hand-writing JSON. Not intended for production us

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Download dcc-mcp-dcc-mcp-core-examples_skills_typed-schema-demo-8d8c969.zip · 2 KB

Install

skills CLI npx skills add https://github.com/dcc-mcp/dcc-mcp-core/tree/main/examples/skills/typed-schema-demo
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install dcc-mcp-dcc-mcp-core@llmmart
Git git clone https://github.com/dcc-mcp/dcc-mcp-core.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole dcc-mcp/dcc-mcp-core collection as a plugin from our marketplace. Git is the plain clone.

README

typed-schema-demo

Companion example for issue #242 — shows a typed handler whose inputSchema and outputSchema are derived entirely from Python type annotations, with no pydantic / jsonschema / attrs dependency.

See SKILL.md for the skill metadata and scripts/demo.py for the handler + schema derivation.

To print the derived schemas:

python -m examples.skills.typed-schema-demo.scripts.demo

The shape matches what pydantic's model_json_schema() would emit (same title, $defs, $ref, anyOf conventions) so adopters who later switch to pydantic will not need to migrate agents or cached schemas.

Skill manifest

Typed Schema Demo (issue #242)

This skill demonstrates the dcc_mcp_core.schema helpers landed for issue #242: authors write a typed handler and tool_spec_from_callable derives both inputSchema and outputSchema from the annotations, with no dependency on pydantic, jsonschema, or attrs.

What to look at

  • scripts/demo.py — one handler using a dataclass input and a dataclass output. The derived schemas are structurally compatible with pydantic's model_json_schema() so callers can swap in pydantic later without migrating agents or cached schemas.

How to wire it into a server

The demo module builds a ToolSpec that is ready for dcc_mcp_core._tool_registration.register_tools(server, [spec]). Inside an adapter (e.g. Maya/Blender), register it during bootstrap:

from dcc_mcp_core._tool_registration import register_tools
from typed_schema_demo.scripts.demo import spec

register_tools(server, [spec], dcc_name="python")

When the negotiated MCP session is 2025-06-18, the gateway publishes outputSchema alongside inputSchema so clients can validate the structuredContent payload our handler returns.

Files (dcc-mcp-core)
  • scripts
    • demo.py 2 KB
      Loading…
  • README.md 640 B
    # typed-schema-demo
    
    Companion example for issue #242 — shows a typed handler whose
    `inputSchema` and `outputSchema` are derived entirely from Python type
    annotations, with no `pydantic` / `jsonschema` / `attrs` dependency.
    
    See `SKILL.md` for the skill metadata and `scripts/demo.py` for the
    handler + schema derivation.
    
    To print the derived schemas:
    
    ```bash
    python -m examples.skills.typed-schema-demo.scripts.demo
    ```
    
    The shape matches what `pydantic`'s `model_json_schema()` would emit
    (same `title`, `$defs`, `$ref`, `anyOf` conventions) so adopters who
    later switch to pydantic will not need to migrate agents or cached
    schemas.
    
  • SKILL.md 1.9 KB
    ---
    name: typed-schema-demo
    description: >-
      Example skill — demonstrates zero-dependency JSON Schema derivation from
      Python dataclasses and type annotations (issue #242). Use as a reference
      when authoring typed handlers that should publish inputSchema /
      outputSchema without hand-writing JSON. Not intended for production use.
    license: MIT
    compatibility: Python 3.10+
    metadata:
      dcc-mcp:
        dcc: python
        recall-context:
          app_type: python
          domain: authoring
          workflow_stage: authoring
          task_category: query
        version: "1.0.0"
        layer: example
        search-hint: "structured schema, dataclass, json schema, inputSchema, outputSchema, typed handler, pydantic-free"
        tags: "example, schema, structured"
    ---
    
    # Typed Schema Demo (issue #242)
    
    This skill demonstrates the `dcc_mcp_core.schema` helpers landed for
    issue #242: authors write a typed handler and
    `tool_spec_from_callable` derives both `inputSchema` and `outputSchema`
    from the annotations, with no dependency on `pydantic`, `jsonschema`, or
    `attrs`.
    
    ## What to look at
    
    - `scripts/demo.py` — one handler using a dataclass input and a dataclass
      output. The derived schemas are structurally compatible with pydantic's
      `model_json_schema()` so callers can swap in pydantic later without
      migrating agents or cached schemas.
    
    ## How to wire it into a server
    
    The demo module builds a `ToolSpec` that is ready for
    `dcc_mcp_core._tool_registration.register_tools(server, [spec])`. Inside
    an adapter (e.g. Maya/Blender), register it during bootstrap:
    
    ```python
    from dcc_mcp_core._tool_registration import register_tools
    from typed_schema_demo.scripts.demo import spec
    
    register_tools(server, [spec], dcc_name="python")
    ```
    
    When the negotiated MCP session is `2025-06-18`, the gateway publishes
    `outputSchema` alongside `inputSchema` so clients can validate the
    `structuredContent` payload our handler returns.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.