-
Notifications
You must be signed in to change notification settings - Fork 281
Labels
Milestone
Description
Renamed to describe_entities (not longer list_entities)
The reason for the rename is that "list" seems like a verb to query the records.
What?
describe_entities
The describe_entities tool is required to enable all the other MCP DML tools.
Behavior
-
This tool is intended to be the first tool called by agents.
-
This tool does not interact with the database; it reads our in-mem metadata.
- It might be that our current metadata does not contain all the values in the output payload definition. If this is true, we should discuss this, but extending our metadata query is likely where we will land, depending on the missing value. The more information we can provide models, the more accurate data agents can be. We want to enable accuracy.
-
This tool can limit payload size to reduce token usage.
- Agents can request only entity names and descriptions.
- Agents can filter to a specific list of entity names.
-
This tool also limits payload content based on the calling role.
- The tool ONLY includes entities where AT LEAST ONE of the CRUD/E permissions is allowed for the calling role.
-
This tool respects configuration.
- The tool only responds when
runtime.mcp.dml-tools = trueORruntime.mcp.dml-tools.describe-entities = true - The tool only includes entities where
entity.mcp.dml-tools = true
- The tool only responds when
How
- Add
describe_entitiesMCP tool (metadata only, no db access) - Add config property (
runtime.mcp.dml-tools.describe-entities.enabled=true) - Update JSON Schema with
runtime.mcp.dml-tools.describe-entities.enabled - Obey configuration (
runtime.mcp.dml-tools.describe-entities.enabled=true) - Add CLI
dab configure --runtime.mcp.dml-tools.describe-entities.enabled true - Update
dab validate(warn whendescribe-entities.enabledand notmcp.enabled) - Add config property (
entity.mcp.dml-tools=true) - Update JSON Schema with
entity.mcp.dml-tools - Obey configuration (
entity.mcp.dml-tools) - Add CLI
dab add User --mcp.dml-tools true - Add CLI
dab udpate User --mcp.dml-tools true
Tool method
/// <summary>
/// Returns the list of entities available to the current role,
/// including fields, keys, parameters (for procedures), and permissions.
/// Does not interact with the database; reads from in-memory metadata only.
/// </summary>
Task<IReadOnlyList<EntityMetadata>> DescribeEntitiesAsync(
[Description("If not provided, full entity metadata is returned. "
+ "This may be a large payload. "
+ "Set to true to return only entity names and descriptions (omit fields, keys, and permissions). "
+ "Optional. Default is false.")]
bool namesOnly = false,
[Description("Optional list of entity names to filter the results. "
+ "Entity names must match those returned by list_entities. "
+ "If not provided, all entities available to the current role are returned.")]
IEnumerable<string>? entities = null);Parameters
- namesOnly (bool, optional, default: false)
// If true, only entity name + description are returned.
if (namesOnly)
return metadata.Select(e => new EntityMetadata { Name = e.Name, Description = e.Description }).ToList();- entities (IEnumerable?, optional)
// If supplied, filter metadata to the specified entities.
if (entities != null && entities.Any())
metadata = metadata.Where(e => entities.Contains(e.Name, StringComparer.OrdinalIgnoreCase)).ToList();Example calls
// Get full metadata for all entities
await DescribeEntitiesAsync();
// Get names and descriptions only
await DescribeEntitiesAsync(namesOnly: true);
// Get full metadata for specific entities
await DescribeEntitiesAsync(entities: new [] { "User", "Order" });Output payload
This metadata should be a mix of db metadata and the DAB configuration.
- Entities and fields should not be included if role has no permissions.
- DAB
includeandexcludefield permission settings should be obeyed. - Permissions must reflect both dab-config.json and role-based security at runtime.
Why?
To enable the other DML (Data Manipulation Language) tools.
Configuration
Command line
Add dab --configure runtime.mcp.dml-tools.describe-entities.enabled true
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress