Skip to content

Add the entry tools #2523

Closed
Closed

Description

@pournasserian

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 with
    • list_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_entry and delete_entry: propose a change. The version (none for a delete) and its operation in a change set commit together, into a set named by change_set_id or a session's set, as create_content_type does. 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_document for invalid fields and get_entry after 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 McpCoverageTests lists the new tools.

Out of scope

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.price with the page.
  • update_entry from 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_entry proposes 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 ToolProviderConformanceTests and the MCP-01 coverage test.
  • Everything above passes on SQLite and PostgreSQL, with no new package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:contentEntries and versioning (CNT)type:featureNew capabilityv2FluentCMS v2 (v2 branch)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions