Package su.onno.mcp

Class MetadataToolFactory

java.lang.Object
su.onno.mcp.MetadataToolFactory
All Implemented Interfaces:
McpToolProvider

public class MetadataToolFactory extends Object implements McpToolProvider
Generates the MCP tool set generically from the MetadataRegistry.

Every tool resolves a descriptor by logical name, enforces access through UiAccessService against the principal captured by McpPrincipalContext, and then delegates to the shared query/command services — the same code path the web UI uses. There is no per-entity code: adding an entity to the application surfaces it here automatically, and a describe_metadata discovery tool lets the model learn entity, field, and enum names at runtime.