mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-10 12:21:54 +00:00
Merge pull request #6381 from dotCooCoo/fix/mcp-schema-keywords
MCP: docs list every JSON Schema keyword in a command's schema
This commit is contained in:
+7
-3
@@ -1387,9 +1387,13 @@ vectorcraft-cli run --cmd file.new --params '{"width":600,"height":200}' --cmd
|
||||
Some commands have a machine-readable parameter schema: at present `view.capsLock`, `view.saved.new`,
|
||||
`view.saved.edit`, `view.saved.list`, `view.transparencyGrid` and `view.snapToGlyph.options`. The engine's
|
||||
`engine.commands` list gives such a command a `schema` field: an object schema in the shape of JSON Schema 2020-12
|
||||
(https://json-schema.org/draft/2020-12), with `type`, `properties`, `required`, `additionalProperties: false`,
|
||||
`minimum`, `maximum`, `exclusiveMinimum` and `exclusiveMaximum` for ranges, `enum`, and `default` for a default the engine fills in. VectorCraft's own
|
||||
fields are `x-since` (the API level that added the command or the parameter), `x-deprecatedSince`, `x-lenient`,
|
||||
(https://json-schema.org/draft/2020-12). Its root has `$schema` (the 2020-12 dialect), `description` when the
|
||||
command has a summary, and `deprecated: true` when the command is deprecated. The schema uses `type`, `properties`, `required` and
|
||||
`additionalProperties: false` for objects; `minimum`, `maximum`, `exclusiveMinimum` and `exclusiveMaximum` for ranges;
|
||||
`enum` for a list of names; `items` for the values of a list; `prefixItems`, `items: false` and `minItems: 2` for a
|
||||
point; `anyOf` and `minItems: 3` for a color, which is a string, a list of at least three numbers or an object;
|
||||
`description` for a parameter's doc text; `default` for a default the engine fills in; and `deprecated: true` for a
|
||||
deprecated parameter. VectorCraft's own fields are `x-since` (the API level that added the command or the parameter), `x-deprecatedSince`, `x-lenient`,
|
||||
`x-unit`, `x-kind` (`id`, `color` or `point`), `x-default` (a default the command works out, such as `toggle`),
|
||||
`x-cost`, `x-writes` (`nothing`, `session`, `preferences` or `document`) and `x-returns`. A parameter that reads null
|
||||
as left out is an `anyOf` with `{"type": "null"}`. Null params read as `{}`, so a schema with no required parameter has
|
||||
|
||||
Reference in New Issue
Block a user