mastercss_trace_class
Trace one class from project extraction through generated CSS, missing CSS classification, and engine inspection.
Contract
Trace a class through source discovery, scanner state, and generated CSS to explain why it is present or missing.
Input
Complete input schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "context": { "type": "string", "enum": [ "project", "preset" ] }, "className": { "type": "string", "minLength": 1 }, "patterns": { "type": "array", "items": { "type": "string" } }, "includeCss": { "type": "boolean" }, "mode": { "type": "string" } }, "required": [ "className" ]}Example
Call mastercss_trace_class from a connected MCP client with these arguments:
{ "className": "p-md", "patterns": [ "src/button.html" ], "includeCss": true}The file must exist under the server root and contain the class you want to trace.
Output
Read status, reason, and detected together, then inspect occurrences, inspection, scanner, and diagnostics. css describes the scan output. A matched inspection and a detected source occurrence answer different questions.
Every tool returns an object with version: 3, metadata, diagnostics and result. Success payload fields described above live in result.data; failure has result.status: "error" and a required { code, message } error. JSON text equals structuredContent. Tool errors set isError. Metadata records actual context, package/language/binding versions, manifest fingerprint, entries and dependencies; unavailable information is null or an empty array.
Complete output schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "version": { "type": "number", "const": 3 }, "metadata": { "type": "object", "properties": { "versions": { "anyOf": [ { "type": "object", "properties": { "languageVersion": { "type": "number" }, "bindingAbiVersion": { "type": "number" }, "packageVersion": { "type": "string" } }, "required": [ "languageVersion", "bindingAbiVersion", "packageVersion" ], "additionalProperties": {} }, { "type": "null" } ] }, "context": { "anyOf": [ { "type": "string", "enum": [ "project", "preset" ] }, { "type": "null" } ] }, "manifestFingerprint": { "type": [ "string", "null" ] }, "entries": { "type": "array", "items": { "type": "string" } }, "dependencies": { "type": "array", "items": { "type": "string" } } }, "required": [ "versions", "context", "manifestFingerprint", "entries", "dependencies" ], "additionalProperties": false }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "phase": { "type": "string" }, "severity": { "type": [ "string", "number" ] }, "message": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } }, "alternatives": { "type": "array", "items": { "type": "string" } }, "source": { "type": "string" }, "range": { "anyOf": [ { "type": "object", "properties": { "start": { "type": "number" }, "end": { "type": "number" } }, "required": [ "start", "end" ], "additionalProperties": false }, { "type": "object", "properties": { "start": { "type": "object", "properties": { "line": { "type": "number" }, "character": { "type": "number" } }, "required": [ "line", "character" ], "additionalProperties": false }, "end": { "type": "object", "properties": { "line": { "type": "number" }, "character": { "type": "number" } }, "required": [ "line", "character" ], "additionalProperties": false } }, "required": [ "start", "end" ], "additionalProperties": false } ] } }, "required": [ "message" ], "additionalProperties": {} } }, "result": { "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "success" }, "data": { "type": "object", "properties": { "manifest": { "type": "object", "properties": { "context": { "type": "string", "enum": [ "project", "preset" ] }, "status": { "type": "string", "enum": [ "loaded", "error" ] }, "fingerprint": { "type": [ "string", "null" ] }, "entries": { "type": "array", "items": { "type": "string" } }, "dependencies": { "type": "array", "items": { "type": "string" } }, "versions": { "type": "object", "properties": { "languageVersion": { "type": "number" }, "bindingAbiVersion": { "type": "number" }, "packageVersion": { "type": "string" } }, "required": [ "languageVersion", "bindingAbiVersion", "packageVersion" ], "additionalProperties": {} } }, "required": [ "context", "status", "fingerprint", "entries", "dependencies" ], "additionalProperties": {} }, "inspection": { "type": "object", "properties": { "className": { "type": "string" }, "matchStatus": { "type": "string", "enum": [ "matched", "unmatched", "ambiguous", "syntax-error" ] }, "cssSyntaxStatus": { "type": "string", "enum": [ "valid", "invalid", "unknown", "not-checked" ] }, "cssValueStatus": { "type": "string", "enum": [ "valid", "invalid", "unknown", "not-checked" ] }, "browserSupport": { "type": "string", "enum": [ "supported", "unsupported", "unknown", "not-checked" ] }, "checks": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "version": { "type": "string" }, "phase": { "type": "string" }, "scope": { "type": "string" } }, "required": [ "name", "version", "phase", "scope" ], "additionalProperties": false } }, "declarations": { "type": "array", "items": { "type": "object", "properties": { "property": { "type": "string" }, "value": { "type": "string" }, "status": { "type": "string", "enum": [ "valid", "invalid", "unknown", "not-checked" ] }, "range": { "type": "object", "properties": { "start": { "type": "number" }, "end": { "type": "number" } }, "required": [ "start", "end" ], "additionalProperties": false }, "error": { "type": "string" } }, "required": [ "property", "value", "status" ], "additionalProperties": {} } }, "rules": { "type": "array", "items": { "type": "object", "properties": { "className": { "type": "string" }, "key": { "type": "string" }, "layer": { "type": "string", "enum": [ "base", "defaults", "components", "utilities" ] }, "type": { "type": "number" }, "sortTier": { "type": "number" }, "text": { "type": "string" }, "selectorText": { "type": "string" }, "priority": { "type": "object", "properties": { "features": { "type": "array", "items": { "type": "object", "properties": { "domain": { "type": "string" }, "feature": { "type": "string" }, "unit": { "type": "string" }, "lower": { "anyOf": [ { "type": "object", "properties": { "value": { "type": "number" }, "inclusive": { "type": "boolean" } }, "required": [ "value", "inclusive" ], "additionalProperties": false }, { "type": "null" } ] }, "upper": { "anyOf": [ { "type": "object", "properties": { "value": { "type": "number" }, "inclusive": { "type": "boolean" } }, "required": [ "value", "inclusive" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "domain", "feature", "unit", "lower", "upper" ], "additionalProperties": false } }, "selector": { "type": "number" }, "conditions": { "type": "array", "items": { "type": "string" } }, "sortKey": { "type": "string" }, "valuePriority": { "type": "number" } }, "required": [ "features", "selector" ], "additionalProperties": false }, "nodes": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" } }, "required": [ "text" ], "additionalProperties": false } }, "variableNames": { "type": "array", "items": { "type": "string" } }, "animationNames": { "type": "array", "items": { "type": "string" } } }, "required": [ "className", "key", "layer", "type", "sortTier", "priority" ], "additionalProperties": false } }, "variables": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "variable": { "type": "object", "properties": { "key": { "type": "string" }, "name": { "type": "string" }, "namespace": { "type": "string" }, "type": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean", "const": false }, { "type": "array", "items": { "type": [ "string", "number" ] } } ] }, "numeric": { "type": "object", "properties": { "value": { "type": "number" }, "unit": { "type": "string" } }, "required": [ "value" ], "additionalProperties": false }, "dependencies": { "type": "array", "items": { "type": "string" } }, "modes": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "string", "number" ] }, "value": { "type": [ "string", "number" ] }, "numeric": { "type": "object", "properties": { "value": { "type": "number" }, "unit": { "type": "string" } }, "required": [ "value" ], "additionalProperties": false } }, "required": [ "type", "value" ], "additionalProperties": false } }, "inline": { "type": "boolean" }, "static": { "type": "boolean" }, "mode": { "type": "string" } }, "required": [ "key", "name", "type", "dependencies" ], "additionalProperties": false } }, "required": [ "key", "variable" ], "additionalProperties": false } }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "phase": { "type": "string" }, "severity": { "type": [ "string", "number" ] }, "message": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } }, "alternatives": { "type": "array", "items": { "type": "string" } }, "source": { "type": "string" }, "range": { "anyOf": [ { "type": "object", "properties": { "start": { "type": "number" }, "end": { "type": "number" } }, "required": [ "start", "end" ], "additionalProperties": false }, { "type": "object", "properties": { "start": { "type": "object", "properties": { "line": { "type": "number" }, "character": { "type": "number" } }, "required": [ "line", "character" ], "additionalProperties": false }, "end": { "type": "object", "properties": { "line": { "type": "number" }, "character": { "type": "number" } }, "required": [ "line", "character" ], "additionalProperties": false } }, "required": [ "start", "end" ], "additionalProperties": false } ] } }, "required": [ "message" ], "additionalProperties": {} } } }, "required": [ "className", "matchStatus", "cssSyntaxStatus", "cssValueStatus", "browserSupport", "checks", "declarations", "rules", "variables" ], "additionalProperties": {} }, "occurrences": { "type": "array", "items": { "type": "object", "properties": { "filePath": { "type": "string" }, "source": { "type": "string" }, "statuses": { "type": "array", "items": { "type": "string" } } }, "required": [ "filePath", "source", "statuses" ], "additionalProperties": false } }, "status": { "type": "string" }, "css": { "type": "object", "properties": { "bytes": { "type": "number" }, "text": { "type": "string" } }, "required": [ "bytes" ], "additionalProperties": {} } }, "required": [ "manifest", "inspection", "occurrences", "status", "css" ], "additionalProperties": {} } }, "required": [ "status", "data" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "error" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message" ], "additionalProperties": false } }, "required": [ "status", "error" ], "additionalProperties": false } ] } }, "required": [ "version", "metadata", "diagnostics", "result" ], "additionalProperties": false}Project context and lifecycle
This operation does not write workspace files.
The local stdio server uses the workspace passed to --root. Confirm the root and intended CSS entries with mastercss_workspace_info before relying on project-dependent values.
See the MCP workflow guide for client setup and the preview/apply workflow.