Manifests

The SAM manifests of this platform, as the Smarter Project MCP server’s get_manifest_schema tool reads them.

Each resource kind’s JSON Schema and example manifest are committed in smarter.apps.api.v1.contract.sam, beside the api contract, as sam/<Kind>.schema.json and sam/<Kind>.example.json. They are the platform’s own, so they describe exactly the manifests that this platform accepts.

A schema is too large, up to about 50 KB, and too nested, with $ref and anyOf, for an LLM to read well. manifest_fields() flattens it into one ManifestField per field, with its dotted path, e.g. spec.config.value, its type, whether it is required, its default and its description. The read-only status is left out: it is never written in a manifest.

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.manifests.ManifestField(*, path, type, required, default=None, description='')[source]

Bases: BaseModel

One field of a manifest, flattened from its kind’s JSON Schema.

default: JsonValue | None
description: str
model_config = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

path: str
required: bool
type: str
smarter.apps.mcpserver.manifests.find_kind(name, directory='/home/runner/work/smarter/smarter/smarter/smarter/apps/api/v1/contract/sam')[source]

Return the kind that a name means, ignoring case.

Parameters:
  • name (str) – e.g. llmclient or LLMClient.

  • directory (str) – The folder of the schemas.

Return type:

str | None

Returns:

The kind, e.g. LLMClient, or None.

smarter.apps.mcpserver.manifests.manifest_example(kind, directory='/home/runner/work/smarter/smarter/smarter/smarter/apps/api/v1/contract/sam')[source]

Return a kind’s example manifest.

Parameters:
  • kind (str) – The kind, e.g. Secret.

  • directory (str) – The folder of the examples.

Return type:

dict[str, Any]

Returns:

The manifest.

Raises:

FileNotFoundError – If the kind has no example.

smarter.apps.mcpserver.manifests.manifest_fields(schema)[source]

Return every field of a manifest, from its kind’s JSON Schema, without the read-only status.

Parameters:

schema (dict[str, Any]) – The kind’s JSON Schema.

Return type:

list[ManifestField]

Returns:

The fields, parents before their children, in the schema’s order.

Example usage:

fields = manifest_fields(manifest_schema("Secret"))
fields[-1].path  # 'spec.config.value'
smarter.apps.mcpserver.manifests.manifest_kinds(directory='/home/runner/work/smarter/smarter/smarter/smarter/apps/api/v1/contract/sam')[source]

Return the kinds that have a committed JSON Schema.

Parameters:

directory (str) – The folder of the schemas.

Return type:

list[str]

Returns:

The kinds, sorted, e.g. ["Account", "ApiConnection", ...].

smarter.apps.mcpserver.manifests.manifest_schema(kind, directory='/home/runner/work/smarter/smarter/smarter/smarter/apps/api/v1/contract/sam')[source]

Return a kind’s JSON Schema.

Parameters:
  • kind (str) – The kind, e.g. Secret.

  • directory (str) – The folder of the schemas.

Return type:

dict[str, Any]

Returns:

The schema.

Raises:

FileNotFoundError – If the kind has no schema.