Skip to content

Reference

This page is the complete technical reference for websketch-mcp — tool schemas, error codes, and common troubleshooting steps.

ToolInputOutputThrows
websketch_validatecapture, optional limits{ ok, error?, warnings? }Never
websketch_rendercaptureASCII textOn invalid capture
websketch_diffbefore, after{ added, removed, modified }On invalid capture
websketch_fingerprintcaptureHex stringOn invalid capture
{
"type": "object",
"properties": {
"capture": {
"type": "object",
"description": "WebSketch IR capture object to validate"
},
"limits": {
"type": "object",
"description": "Optional resource limits",
"properties": {
"maxNodes": { "type": "number" },
"maxDepth": { "type": "number" },
"maxStringLength": { "type": "number" }
}
}
},
"required": ["capture"]
}
{
"type": "object",
"properties": {
"capture": {
"type": "object",
"description": "WebSketch IR capture object"
}
},
"required": ["capture"]
}
{
"type": "object",
"properties": {
"before": {
"type": "object",
"description": "Before capture"
},
"after": {
"type": "object",
"description": "After capture"
}
},
"required": ["before", "after"]
}
{
"type": "object",
"properties": {
"capture": {
"type": "object",
"description": "WebSketch IR capture object"
}
},
"required": ["capture"]
}

All error codes are namespaced with the WS_ prefix.

CodeSourceMeaning
WS_INVALID_ARGSvalidate, render, diff, fingerprintRequired arguments are missing or have the wrong type
WS_INVALID_CAPTUREvalidate, render, diff, fingerprintThe capture object fails structural validation
WS_LIMIT_EXCEEDEDvalidateA resource limit (node count, depth, or string length) was exceeded
WS_INTERNALAnyAn unexpected runtime error occurred inside the server

From websketch_validate (always isError: false):

{
"ok": false,
"error": {
"code": "WS_INVALID_CAPTURE",
"message": "Invalid capture: 2 validation issues",
"issues": [
{ "path": "root.type", "message": "Expected string" }
]
}
}

From other tools (isError: true):

[WS_INVALID_CAPTURE] Invalid capture in 'before': 1 issue
root.type: Expected string
FieldValue
Namewebsketch-mcp
Transportstdio (stdin/stdout)
ProtocolMCP (JSON-RPC 2.0)
Capabilitiestools
NetworkNone — no outbound connections
FilesystemNone — no reads or writes
TelemetryNone

”command not found” after global install

Section titled “”command not found” after global install”

The npm global bin directory may not be in your PATH. Check with:

Terminal window
npm config get prefix

On most systems, adding $(npm config get prefix)/bin to your PATH resolves this. Alternatively, use npx websketch-mcp to bypass the global bin requirement.

If npm run build fails after cloning:

Terminal window
npm run clean
npm ci
npm run build

The clean script removes the dist/ folder, and npm ci ensures exact dependency versions from the lockfile.

The build process adds a shebang line and sets the executable bit on dist/index.js automatically. If the executable bit is missing:

Terminal window
chmod +x dist/index.js

Make sure the capture follows the WebSketch IR specification. The most common issue is a missing or malformed root node. Use websketch_validate to get a detailed list of what is wrong — the issues array in the error response pinpoints the exact path and problem.

If you are working with pages that exceed the default resource limits, pass custom limits to websketch_validate:

{
"capture": { ... },
"limits": {
"maxNodes": 50000,
"maxDepth": 100
}
}

Be aware that very large captures will also take longer to render, diff, and fingerprint.