Repository navigation
Add the entry tools #2523
Copy link
Copy link
Closed
Labels
area:contentEntries and versioning (CNT)Entries and versioning (CNT)type:featureNew capabilityNew capabilityv2FluentCMS v2 (v2 branch)FluentCMS v2 (v2 branch)
Milestone
Description
Part of #2416 (F-CNT). The last slice: the entry tools agents call over MCP (MCP-01, P1), following the write-tool conventions of #2514. It covers the CNT row of the MCP-01 coverage test (#2517).
Scope
- Core (
FluentCMS.Core.Builtin.Tools):EntryTools, a tool provider withlist_entries: the entries of a content type with their versions and state.get_entry: an entry with its state, its pointers and the fields of its latest draft or of a named version.get_entry_history: every version of an entry, oldest first.get_resolved_entry: a version read with each entity-field reference replaced by the entity's current published value, and the references that could not be resolved.get_where_used: the entries whose latest draft or published version uses an entry, one field of an entity, or a media asset.create_entry,update_entryanddelete_entry: propose a change. The version (none for a delete) and its operation in a change set commit together, into a set named bychange_set_idor a session's set, ascreate_content_typedoes. An update is based on the entry's published version, so it proposes a create while the entry has never been published. A delete proposes unpublishing the entry. The operation is an entity operation for an entity type.
- Error hints that point an agent at the next call, such as
get_schema_documentfor invalid fields andget_entryafter a version conflict. - Scope (MCP-05): resolved views and where used refuse an entry of a type outside the agent's scope, and where used leaves out the entries an agent may not read.
- The CNT row of
McpCoverageTestslists the new tools.
Out of scope
- Entity-specific tools for facts, validity and blast radius (F-ENT F-ENT: Entity registry with sources, validity and blast radius #2417), and media (F-MED F-MED: Media library with required alt text #2427).
- Soft delete and restore as tools: they bypass change sets, so they stay with people for now.
- Amending an operation already in a set, so a second update of one entry in one set is refused as a duplicate, as for content types.
- Moving the change set target into
IEntryDirectory, which follows the pattern SCH-05 lands with.
Acceptance
- Over MCP, an agent creates a product entity and a product page that references its price in one set and submits it. A person publishes it, and the agent reads the page resolved with the price, and where used on
product.pricewith the page. update_entryfrom a stale version is refused with a hint to read the entry again; invalid fields come back together, by field, with a hint to read the schema document; a refused write stores no version.delete_entryproposes unpublishing; an entry that is not published is refused.- An agent cannot read, resolve or find usages of entries of types outside its scope.
- Every tool passes
ToolProviderConformanceTestsand the MCP-01 coverage test. - Everything above passes on SQLite and PostgreSQL, with no new package.
Metadata
Metadata
Assignees
Labels
area:contentEntries and versioning (CNT)Entries and versioning (CNT)type:featureNew capabilityNew capabilityv2FluentCMS v2 (v2 branch)FluentCMS v2 (v2 branch)
Activity