`describe_entities` should merge config fields with DB columns for tables/views
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
For stored-procedure entities, describe_entities now uses the database as the source of truth for parameters and treats config as an overlay (#3400). The same merge does not yet happen for tables and views: the fields array surfaced to MCP agents comes from entity.Fields in config alone, and the database columns are ignored.
Why this matters
Most users do not list every column under entities.<entity>.fields in config — that block is typically used only when a column needs an alias, a description, or a primaryKey override. As a result, today:
- A table or view entity with no
fields:block in config emits an emptyfieldsarray to MCP agents. The agent has no way to see what columns the entity actually has. - A table or view entity with a partial
fields:block (e.g. only one column described for an alias) emits only that column — the rest of the table is hidden from the agent.
This is the same class of agent-can't-see-required-inputs bug that #3400 fixed for stored-procedure parameters.
Where the gap lives
DescribeEntitiesTool.BuildFieldMetadataInfo:
private static List<object> BuildFieldMetadataInfo(List<FieldMetadata>? fields)
{
List<object> result = new();
if (fields != null)
{
foreach (FieldMetadata field in fields)
{
result.Add(new
{
name = field.Alias ?? field.Name,
description = field.Description ?? string.Empty
});
}
}
return result;
}
The DB-side equivalent lives at SourceDefinition.Columns (a Dictionary<string, ColumnDefinition>) on the resolved DatabaseObject — same access pattern the SP parameter merge uses.
Proposed merge rules (mirroring #3400)
For table and view entities:
name: from DB (Columns.Keys); configAliasoverrides for the surfaced name.description: config-only (no reliable DB-side column description in MSSQL/PostgreSQL/MySQL metadata).primaryKey: from DB (SourceDefinition.PrimaryKey); configPrimaryKeyoverrides if present.- (Optional) type info: surface
ColumnDefinition.SystemType/DbTypeso agents know the column shape. - DB columns not listed in config are still surfaced (with no alias/description) so agents see the full schema.
- Fall back to emitting config fields as-is when DB metadata is unavailable (same degraded path as the SP parameter merge).
Acceptance criteria
- Tables and views with no
fields:config block surface all DB columns todescribe_entities. - Config
Alias,Description, andPrimaryKeyoverlay correctly when present. - DB columns not listed in config are still surfaced.
- Degraded fallback: when DB metadata is unavailable, config-declared fields are emitted as-is.
- Unit tests mirror the SP parameter merge tests in
DescribeEntitiesStoredProcedureParametersTests.
Related
- #3400 — original SP parameter merge issue
- PR #_____ — SP parameter merge implementation (introduced
McpMetadataHelper.TryResolveDatabaseObject, which this work can reuse)
- Lingua principale
- C#
- Stelle
- 1.5k
- Fork
- 371
- Merge medio
- 9g 2h
- PR unite (30g)
- 10
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/data-api-builder
-
pgsql
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/data-api-builder#3598 ·
I maintainer di solito rispondono entro 1 giorno
-
2.x cli mcp-server
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/data-api-builder#3576 ·
I maintainer di solito rispondono entro 1 giorno
-
2.x health-endpoint
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/data-api-builder#3570 ·
I maintainer di solito rispondono entro 1 giorno
-
2.x telemetry
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/data-api-builder#3564 ·
I maintainer di solito rispondono entro 1 giorno
-
2.x telemetry
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Azure/data-api-builder#3562 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Azure/data-api-builder
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fluentassertions/fluentassertions#3353 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 78/100
unoplatform/uno#24769 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
AvaloniaUI/Avalonia#22323 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
microsoft/onnxruntime-genai#2633 ·
I maintainer di solito rispondono entro 1 giorno