WebMCP Tool Schema Design

VerifiedSafe

Design JSON Schemas for WebMCP tool inputs and outputs — proper types, constraints, nested objects, and agent-friendly documentation. Use when defining or refining tool schemas for agent consumption.

Sby Skills Guide Bot
DevelopmentIntermediate
7/24/2026
Claude CodeCursorWindsurf
#json-schema#webmcp#tool-definitions#agent-interfaces#validation

Recommended for

Automated summary

This skill guides the design of JSON Schemas for WebMCP tool inputs and outputs so agents can consume them reliably.

Strengths

  • Explains the dual role of the schema: agent guidance and browser-side input validation
  • Provides a type-to-use-case table plus ready-made commerce patterns (product search, add to cart, shipping address)
  • Stresses `description` annotations, constraints (enum, pattern, minimum/maximum) and a minimal set of required parameters
  • Gives concrete output conventions: status field, structured data, pagination info, and error objects

Limitations

  • The file cuts off mid-way through the "Minimal surface" principle, so the design rules are incomplete
  • WebMCP does not formally define an output schema, so the output conventions are recommendations rather than a standard
  • It mandates fetching live docs and web searches before writing code, adding steps and requiring network access
When to use it

Reach for it when you need to write or tighten an `inputSchema` for a WebMCP tool that an agent will call.

When not to use it

Avoid it for schema work outside WebMCP (plain OpenAPI, proprietary model function calling) without first checking how the specifications differ.

Security analysis

Safe
Quality score86/100

This is a documentation/guidance skill about designing JSON Schemas for WebMCP tools. It contains no executable payloads, no destructive commands, no network calls that pipe into shell, and no credential handling. The declared tools (Bash, WebFetch, WebSearch) are justified for fetching specs and running local work, and all examples are benign schema definitions. It even explicitly advises against collecting sensitive data such as passwords or full card numbers.

No concerns found

How this analysis is made

Examples

Product search schema
Design a WebMCP inputSchema for a tool that searches a product catalog, with a required search query and optional category, max price, and sort order filters.
Tighten an existing schema
Here is my add-to-cart inputSchema — review it and add missing descriptions, constraints, and defaults so an agent can fill it in correctly.
Address validation rules
Add enum and pattern constraints to my shipping address inputSchema so zip codes and countries are validated before the tool executes.

name: webmcp-tool-schemas description: Design JSON Schemas for WebMCP tool inputs and outputs — proper types, constraints, nested objects, and agent-friendly documentation. Use when defining or refining tool schemas for agent consumption. allowed-tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch

WebMCP Tool Schema Design

Before writing code

Fetch live docs:

  1. Fetch https://webmachinelearning.github.io/webmcp/ for the inputSchema specification and any constraints
  2. Web-search webmcp inputSchema JSON Schema requirements for schema format details
  3. Web-search JSON Schema draft specification for the JSON Schema version used by WebMCP
  4. Web-search webmcp tool schema best practices for community guidance

Conceptual Architecture

Role of Schemas in WebMCP

The inputSchema in a tool definition serves two purposes:

  1. Agent guidance — The agent reads the schema to understand what parameters to provide
  2. Input validation — The browser validates agent-provided input against the schema before calling execute

Schema Structure

WebMCP uses standard JSON Schema. Each tool's inputSchema is a JSON Schema object:

inputSchema: {
  type: "object",
  properties: {
    paramName: { type: "string", description: "What this parameter is" },
    // ...more properties
  },
  required: ["paramName"]
}

Property Types

| JSON Schema Type | Use For | Example | |-----------------|---------|---------| | string | Text, IDs, codes | Product ID, search query, coupon code | | number | Decimal values | Price, weight, rating | | integer | Whole numbers | Quantity, page number | | boolean | True/false flags | In-stock filter, gift wrap option | | array | Lists | Product IDs, selected categories | | object | Nested structures | Address, payment details |

Description Annotations

Always add description to properties — agents use these to decide what values to provide:

properties: {
  query: {
    type: "string",
    description: "Search keywords for product catalog"
  },
  maxPrice: {
    type: "number",
    description: "Maximum price in USD. Omit to search all prices."
  }
}

Constraints

Use JSON Schema constraints to guide agent input:

  • minLength / maxLength for strings
  • minimum / maximum for numbers
  • enum for fixed value sets
  • pattern for regex validation
  • minItems / maxItems for arrays
  • default for optional parameters with defaults

Commerce Schema Patterns

Product search:

{
  type: "object",
  properties: {
    query: { type: "string", description: "Search keywords" },
    category: { type: "string", enum: ["electronics", "clothing", "home"] },
    maxPrice: { type: "number", minimum: 0 },
    sortBy: { type: "string", enum: ["relevance", "price_asc", "price_desc", "rating"] }
  },
  required: ["query"]
}

Add to cart:

{
  type: "object",
  properties: {
    productId: { type: "string", description: "Product identifier" },
    quantity: { type: "integer", minimum: 1, maximum: 99, default: 1 },
    variant: { type: "string", description: "Size, color, or variant ID" }
  },
  required: ["productId"]
}

Shipping address:

{
  type: "object",
  properties: {
    street: { type: "string" },
    city: { type: "string" },
    state: { type: "string" },
    zipCode: { type: "string", pattern: "^[0-9]{5}(-[0-9]{4})?$" },
    country: { type: "string", enum: ["US", "CA", "UK"] }
  },
  required: ["street", "city", "state", "zipCode", "country"]
}

Output Conventions

While WebMCP doesn't formally specify an output schema, tools should return predictable JSON:

  • Always include a status or success field
  • Return structured data, not HTML or plain text
  • Include pagination info for list results (total, page, pageSize)
  • Return error objects with code and message for failures

Schema Design Principles

  1. Minimal surface — Only require parameters the tool actually needs
  2. Descriptive — Every property should have a description
  3. Constrained — Use enum, minimum, maximum to prevent invalid inputs
  4. Flat when possible — Avoid deep nesting; agents handle flat schemas better
  5. Consistent — Use the same naming conventions across all tools (camelCase)
  6. No sensitive data — Never ask for passwords, SSNs, or full card numbers in schemas

Fetch the WebMCP spec for the exact JSON Schema version supported and any WebMCP-specific constraints before designing schemas.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/webmcp-tool-schema-design-mryiqgkg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/webmcp-tool-schema-design-mryiqgkg/download' --output '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md.part' && mv '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md.part' '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md' && test -s '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/webmcp-tool-schemas' && cp -R '.skill-downloads/webmcp-tool-schema-design-mryiqgkg' '.claude/skills/webmcp-tool-schemas'

Cursor
test -f '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md' && test -s '.skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/webmcp-tool-schemas' && cp -R '.skill-downloads/webmcp-tool-schema-design-mryiqgkg' '.cursor/skills/webmcp-tool-schemas'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/webmcp-tool-schema-design-mryiqgkg'

openskills read 'webmcp-tool-schema-design-mryiqgkg'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/webmcp-tool-schema-design-mryiqgkg/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills