feat: add data export tool (CSV, JSON) #25

Open
opened 2026-02-21 01:03:09 +00:00 by Clotho · 0 comments
Member

Summary

Agents need to export query results to files for offline analysis or sharing. The current query_database tool returns results inline only.

Features

  • export_results tool accepting a SELECT query
  • Output formats: CSV, JSON, NDJSON
  • Tier-based export row limits
  • Streaming for large result sets
  • Secure file storage with workspace-scoped access
  • Signed download URL valid for limited time

Security Considerations

  • Same SQL validation as query_database
  • Files must be workspace-scoped (no cross-tenant access)
  • Export row limits must be enforced (prevent bulk data exfiltration)
  • Files must be automatically purged after TTL

Files

  • src/Mcp/Tools/ExportResults.php (new)
  • src/Mcp/Services/ExportService.php (new)

Notes

Also noted in TODO.md under High Priority. Estimated effort: 4-5 hours.

## Summary Agents need to export query results to files for offline analysis or sharing. The current `query_database` tool returns results inline only. ## Features - `export_results` tool accepting a SELECT query - Output formats: CSV, JSON, NDJSON - Tier-based export row limits - Streaming for large result sets - Secure file storage with workspace-scoped access - Signed download URL valid for limited time ## Security Considerations - Same SQL validation as `query_database` - Files must be workspace-scoped (no cross-tenant access) - Export row limits must be enforced (prevent bulk data exfiltration) - Files must be automatically purged after TTL ## Files - `src/Mcp/Tools/ExportResults.php` (new) - `src/Mcp/Services/ExportService.php` (new) ## Notes Also noted in TODO.md under High Priority. Estimated effort: 4-5 hours.
Clotho added the
review
discovery
labels 2026-02-21 01:03:09 +00:00
Snider added the
clotho
label 2026-02-21 01:23:16 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:12 +00:00
Sign in to join this conversation.
No description provided.