Azure / Azure/data-api-builder
[Bug]: Field descriptions cannot handle a comma in the string
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
### What happened?
Hi All,
I am setting up a Proof of Concept that uses the MCP functionality of Data API Builder. An important, maybe even crucial part of this, is having clear descriptions of the tables and it's fields. So that the LLM can understand what data is available, how it is interconnected, and in what scenarios it makes sense to query or filter.
To achieve that I am following [these guidelines](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/how-to-add-descriptions).
Unfortunately I am running into a small issue here. I noticed that when adding a description for a table, using a command like this `dab add Orders \
--source dbo.Orders \
--permissions "authenticated:read" \
--description "Customer purchase orders with line items, shipping details, and payment status"` it **can** handle comma's. The dab-config.json gets updated with this **full** description.
However, when I add field descriptions using commands like this `dab update Products --fields.name "RecordIsActive" --fields.description "Indicates whether the record is active. When false, the record may be historical and still exist, but is no longer actively used. Type: boolean"` the dab-config.json is updated with a description. **But only the part of the description up to the first comma!** The result in dab-config.json is
> {
"name": "RecordIsActive",
"description": "Indicates whether the record is active. When false",
"primary-key": false
}
It looks like `--fields.description` is not able to handle comma's. When I remove the comma's from the description and rerun the command, the dab-config.json does get updated with the full description.
It looks like a small bug that is easy to overlook but can have a big impact in how well the agent/LLM performs.
I have seen this behaviour in both the latest officially released version 1.7.93 and the latest release-candidate 2.0.0-rc.
It would be great if this can be fixed.
Kind regards,
Erik Lormans
### Version
1.7.93 and 2.0.0-rc
### What database are you using?
Azure SQL
### What hosting model are you using?
AppService
### Which API approach are you accessing DAB through?
MCP
### Relevant log output
```Text
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.