Skip to main content

create_agent

Create a stored Agent definition by its caller-relative name. A standalone personal credential uses a bare name. In organization scope, use me/name for the represented member's private space or <team>/name for a bound team. An unprefixed organization-scoped name denotes the shared organization catalogue, which is currently read-only over MCP. This defines reusable identity and behavior—it does not start, assign, or execute an agent.

Parameters​

ParameterTypeRequiredDescription
namestringYesCaller-relative address: bare with a standalone personal credential, me/name in private organization space, or <team>/name for a bound team.
descriptionstringNoHuman-readable description. Defaults to empty.
definitionobjectYesComplete identity and behavior definition stored as version 1.
version_limit_policystringNoreject (default) or prune_oldest when a later update reaches the retained-version limit.

The definition contains:

FieldTypeRequiredDescription
identitystringYesCore role and identity instructions.
categoriesobject[]NoOrdered categories; each has required key and name, plus optional description.
componentsobject[]NoOrdered behavior components.
components[].keystringYesStable lowercase key beginning with a letter.
components[].category_keystringYesKey of a category in the same definition.
components[].namestringYesHuman-readable component name.
components[].descriptionstringNoOptional explanation.
components[].applicabilitystringYesalways or conditional.
components[].load_whenstringConditionalRequired for conditional; omit for always.
components[].instructionsstringYesInstructions contributed when the component is active.

Response​

FieldTypeDescription
idstringStable internal definition identifier, returned as metadata.
namestringCanonical caller-relative address of the created Agent definition.
active_versionintegerThe initial active version (1).

Example​

{
"name": "engineering/reviewer",
"description": "Reviews risky changes",
"definition": {
"identity": "You are a careful code reviewer.",
"categories": [{ "key": "quality", "name": "Quality" }],
"components": [
{
"key": "evidence",
"category_key": "quality",
"name": "Evidence",
"applicability": "always",
"instructions": "Cite concrete code before reporting a defect."
}
]
}
}

Result:

{
"id": "018f...c2a1",
"name": "engineering/reviewer",
"active_version": 1
}

Errors​

Domain and authorization failures are tool results with isError: true; malformed arguments and server faults are JSON-RPC protocol errors.

CodeCause
agent_name_takenThat name already exists in the target ownership space.
invalid_agent_nameThe bare Agent name is invalid.
empty_nameThe name is empty after removing the team prefix.
agent_required_fieldA required definition field is empty.
agent_field_too_longA definition or metadata field exceeds its limit.
too_many_agent_itemsThe definition contains too many categories or components.
agent_definition_too_largeThe complete definition exceeds its total-size limit.
invalid_agent_key / duplicate_agent_keyA category or component key is invalid or repeated.
agent_missing_categoryA component references a category that is absent.
agent_always_has_load_whenAn always-on component supplied load_when.
agent_conditional_missing_load_whenA conditional component omitted load_when.
invalid_version_policyThe version policy is not reject or prune_oldest.
agent_limit_reachedThe target space has reached its plan's Agent limit.
forbiddenThe credential lacks create authority, uses me/ outside organization scope, or targets the read-only organization catalogue.
team_not_foundNo team with that prefix is bound to this credential.
personal_cannot_address_teamA standalone personal credential used a Team prefix.
no_personal_spaceA userless organization credential used me/name.
invalid_argumentsInput is missing or does not match the schema.
internal_errorAn unexpected server error occurred.

Notes​

  • The tool is governed: it requires Tools and tool-policy admission. A standalone personal target additionally requires its Agent-create permission; a Team target requires a binding and the matching Team permission; me/name requires an acting user with active organization membership. It does not require Agents merely to write the definition.
  • Creating a definition does not assign it to the current credential. Assignment remains a deliberate dashboard action.
  • Organization-catalog definitions cannot be created over MCP. In organization scope, create privately with me/name or use a bound team; publish through the dashboard.