feat(firestore-mongodb): add firestore-execute-mql and firestore-get-… - #3826
feat(firestore-mongodb): add firestore-execute-mql and firestore-get-…#3826pl04351820 wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces MongoDB Query Language (MQL) query execution and schema retrieval capabilities for Firestore by adding the firestore-execute-mql and firestore-get-schema tools, along with their respective documentation and unit tests. Feedback on the changes includes improving the robustness of the Firestore source implementation by using json.Marshal instead of fmt.Sprintf for query construction, capping the sampleSize to prevent potential memory issues, and including the response body in API error messages. Additionally, the reviewer noted that the firestore-execute-mql tool should default to read-only annotations rather than destructive annotations, which also requires updating the corresponding unit tests.
…e size and error reporting
…ampledDocCount and update database terminology
Description
This PR introduces two new Model Context Protocol (MCP) tools for Firestore with MongoDB-compatibility (NL2NoSQL) support:
firestore-execute-mql(execute_mql):structuredPipelinewith the"iql"stage andread_only: trueoption, dispatching to Firestore'sdocuments:executePipelineendpoint with routing headers (x-goog-request-paramsandx-goog-firestore-api-requester).firestore-get-schema(get_schema):"get_schema"structured pipeline stage withmongodbsemantics ({ "collection": "<name>", "semantics": "mongodb" }), flattening nested fields into dot-separated paths with their data types.Reference: go/fs-nl2nosql-mcp-tools
Summary of Changes:
internal/sources/firestore/firestore.go: AddedExecutePipelineandGetSchemamethods with structured pipeline payloads and header context.internal/tools/firestoremongodb/: Addedfirestore-execute-mqlandfirestore-get-schematool implementations with parameters, annotations, and input validation.firestoreexecutemql_test.go,firestoregetschema_test.go,firestore_internal_test.go).cmd/internal/imports.go: Registered new tool packages.docs/en/integrations/firestore/tools/: Added documentation pages following Hugo documentation standards.PR Checklist
!if this involve a breaking change🛠️ Fixes #<issue_number_goes_here>