Manifest Tools

The MCPServer’s public tools that read and validate the platform’s manifest schemas.

  • get_manifest_schema: a resource kind’s example manifest, and its fields.

  • validate_manifest: a manifest’s errors, from the platform’s own validation.

They help an LLM write a correct manifest: it reads a kind’s fields before writing one, and validates what it wrote before giving it to the user. Both work on this platform’s own committed schemas, so they describe the manifests that this platform’s version accepts, and neither uses a repository’s index. The schema reading and the validation are in smarter.apps.mcpserver.services.manifests.

Note

Experimental. The MCPServer was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.

class smarter.apps.mcpserver.protocol.tools.manifests.GetManifestSchemaTool(scope, github_token=None)[source]

Bases: PublicTool

The get_manifest_schema tool: a resource kind’s example manifest, and the fields of its JSON Schema.

Reads: the committed JSON Schemas and example manifests of smarter.apps.api.v1.contract.sam, from the platform’s own files.

Result: Markdown. Without a kind, the list of kinds. With one, the kind’s description, its example manifest in YAML, a link to its full JSON Schema on GitHub, and one line per field, as many as fit in MAX_READ_CHARACTERS.

Side effects: none. The result is cached like every read-only tool’s (see smarter.apps.mcpserver.protocol.caching).

arguments_model

alias of GetManifestSchemaArguments

description: ClassVar[str] = "Return a Smarter resource kind's example manifest, in YAML, and every field that its manifest may have: its path, type, whether it is required, its default and its description, from the JSON Schema that this platform validates manifests with. Use it before writing, fixing or explaining a manifest, rather than guessing its fields. Omit kind to list the kinds."

What the tool does, and when to call it.

The LLM reads it to decide which tool to call.

static format_field(field)[source]

Return one field, as a Markdown list item.

Parameters:

field (ManifestField) – The field.

Return type:

str

Returns:

e.g. - `spec.config.value` (string, required): The secret's value.

static list_kinds(kinds)[source]

Return the list of resource kinds, for a call without a kind.

Parameters:

kinds (list[str]) – The kinds, from manifest_kinds().

Return type:

str

Returns:

Markdown: a heading, a sentence that says how to use the tool, and one bullet per kind.

name: ClassVar[str] = 'get_manifest_schema'

The tool’s name, which the LLM calls it by, e.g. search_code.

run(arguments)[source]

Describe a kind’s manifest, or list the kinds.

Parameters:

arguments (PublicToolArguments) – The validated GetManifestSchemaArguments.

Return type:

str

Returns:

The description, as Markdown.

Raises:

SmarterMCPServerToolError – If kind is not a resource kind.

static schema_url(kind)[source]

Return the GitHub url of a kind’s JSON Schema, in the smarter repository.

The smarter repository is normally one of SMARTER_PROJECT_REPOSITORIES. A test may replace them, so a stand-in repository with the same name builds the link then.

Parameters:

kind (str) – The kind, e.g. Secret.

Return type:

str

Returns:

The url, on the smarter repository’s indexed branch.

title: ClassVar[str] = 'Get manifest schema'

The tool’s human-readable name, which an MCP client may show.

uses_repository: ClassVar[bool] = False

Whether the tool takes a repository argument on the public endpoint of every repository.

class smarter.apps.mcpserver.protocol.tools.manifests.ValidateManifestTool(scope, github_token=None)[source]

Bases: PublicTool

The validate_manifest tool: validate a manifest with the platform’s own validation, without applying it.

Reads: the manifest that the LLM wrote, which is parsed without YAML aliases and validated by validate_manifest_text(), the validation of the cli’s validate command, without the checks that make requests.

Result: text that says the manifest is valid, or lists each error with the dotted path of its field.

Side effects: none: nothing is saved or applied. The result is cached, keyed by the manifest, like every read-only tool’s (see smarter.apps.mcpserver.protocol.caching).

arguments_model

alias of ValidateManifestArguments

description: ClassVar[str] = 'Validate a Smarter manifest, in YAML or JSON, against the model of its kind: the validation that `smarter apply` does first, without applying it. Returns whether it is valid, and each error with the path of its field. Call it on every manifest that you write or fix, before you give it to the user, and fix what it reports. Checks that need the network, e.g. that an image url responds, are skipped.'

What the tool does, and when to call it.

The LLM reads it to decide which tool to call.

name: ClassVar[str] = 'validate_manifest'

The tool’s name, which the LLM calls it by, e.g. search_code.

run(arguments)[source]

Validate the manifest, and report whether it is valid, or its errors.

Parameters:

arguments (PublicToolArguments) – The validated ValidateManifestArguments.

Return type:

str

Returns:

The report, as text.

Raises:

SmarterMCPServerToolError – If the manifest is too long, or is not YAML.

title: ClassVar[str] = 'Validate manifest'

The tool’s human-readable name, which an MCP client may show.

uses_repository: ClassVar[bool] = False

Whether the tool takes a repository argument on the public endpoint of every repository.