Skip to content

Teach agents your vocabulary

Agents and MCPMCPHTTPSDKmcp.domainDictionaryget_domain_contextPUT /api/domainon_cancelentity_facet

A domain dictionary maps the floor's jargon to roles, facets and workflows, so an agent hears a noun and knows the query.

The situation

People say “bin B-7” and “reset it.” The platform speaks in roles, escalations and metadata facets. An agent that does not know the translation guesses, and a wrong cancel on the wrong row costs real work.

The recipe

Declare the dictionary in the start config:

start.ts
mcp: {
domainDictionary: {
name: 'floor',
version: '3',
overview: 'Orders move from pick to ship; each station is a role.',
terms: [
{ term: 'bin', aliases: ['tote'], kind: 'entity', maps_to: { roles: ['binning'] },
guidance: 'Keyed by binKey. Find one with facets={binKey: value}.' },
{ term: 'reset', kind: 'action', maps_to: { verb: 'cancel', role: 'packing' },
guidance: 'Cancel the row; the dispatcher re-mints the attempt.' },
{ term: 'claims expire = recovery', kind: 'rule',
guidance: 'A lapsed claim returns the row to the queue.' },
],
},
},

Term kinds are entity, role, workflow, facet, action and rule. An agent asks for context:

tool call: get_domain_context
{ "topic": "term", "name": "tote" }

name matches a term or any alias, case-insensitively. With no arguments the tool returns the index, and the MCP instructions carry the overview plus a names-only index.

The guarantee

Structure is derived from the live registries at read time: an entity’s id facet from its role’s entity_facet, a role’s verb semantics from properties.on_cancel and on_timeout. Writes validate references, and unknown roles or workflows are rejected with a 422 naming them. get_domain_context works on every deployment, dictionary or none. See MCP.