mastercss_suggest_syntax
Return language-service completions and hover context for a document position.
Contract
Request language-service completion candidates and hover information at a position in an unsaved document.
Input
Complete input schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "context": { "type": "string", "enum": [ "project", "preset" ] }, "content": { "type": "string" }, "filePath": { "type": "string" }, "position": { "type": "object", "properties": { "line": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "character": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "line", "character" ] }, "triggerCharacter": { "type": "string" }, "limit": { "type": "integer", "minimum": 1, "maximum": 200 } }, "required": [ "content", "filePath", "position" ]}Example
Call mastercss_suggest_syntax from a connected MCP client with these arguments:
{ "content": "<div class=\"p:\"></div>", "filePath": "src/card.html", "position": { "line": 0, "character": 14 }, "limit": 5}The cursor follows p: in the class attribute.
Output
The result includes completions, their untruncated total, optional hover, and manifest status. A completion list is editor assistance; verify the selected class against the intended project and rendered UI.
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": {} }, "completions": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "kind": { "type": "number" }, "detail": { "type": "string" }, "insertText": { "type": "string" }, "sortText": { "type": "string" }, "documentation": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "kind": { "type": "string" }, "value": { "type": "string" } }, "required": [ "kind", "value" ], "additionalProperties": false } ] } }, "required": [ "label" ], "additionalProperties": {} } }, "total": { "type": "number" } }, "required": [ "manifest", "completions", "total" ], "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.