Skip to content

Commit 3be1e3c

Browse files
committed
deploy: docs: add advanced usage section for Parameterized Secure Views in cl… (googleapis#2860)
Adds an Advanced Usage section to the cloud-gemini-data-analytics-query tool documentation covering Parameterized Secure Views (PSV). PSV provides Row-Level Access Control (RLAC) by requiring mandatory parameters at query time, preventing callers from accessing underlying base tables directly. This section explains how PSV works conceptually and provides ready-to-use YAML configuration examples for both PostgreSQL and MySQL engines, including the correct parameterizedSecureViewParameters structure. - [ ] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - [ ] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here> a8cc6a1
1 parent 64f2fff commit 3be1e3c

29 files changed

+81
-12
lines changed

dev/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7417,7 +7417,7 @@ returned. Otherwise, the selection is not guaranteed.&lt;/p>
74177417
&lt;p>The tool returns a single JSON object representing the document, wrapped in a
74187418
JSON array.&lt;/p>
74197419
&lt;h2 id="compatible-sources">Compatible Sources&lt;/h2>
7420-
&lt;h2 id="hahahugoshortcode300s0hbhb">
7420+
&lt;h2 id="hahahugoshortcode301s0hbhb">
74217421

74227422

74237423
&lt;div class="compatibility-section">

dev/integrations/cloudgda/tools/cloud-gda-query/index.html

Lines changed: 29 additions & 4 deletions
Large diffs are not rendered by default.

dev/integrations/mongodb/tools/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ returned. Otherwise, the selection is not guaranteed.&lt;/p>
9494
&lt;p>The tool returns a single JSON object representing the document, wrapped in a
9595
JSON array.&lt;/p>
9696
&lt;h2 id="compatible-sources">Compatible Sources&lt;/h2>
97-
&lt;h2 id="hahahugoshortcode300s0hbhb">
97+
&lt;h2 id="hahahugoshortcode301s0hbhb">
9898

9999

100100
&lt;div class="compatibility-section">

dev/integrations/mongodb/tools/mongodb-find-one/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,11 @@
444444
<a href=https://github.com/googleapis/genai-toolbox/edit/main/docs/en/integrations/mongodb/tools/mongodb-find-one.md class="td-page-meta--edit td-page-meta__edit" target=_blank rel=noopener><i class="fa-solid fa-pen-to-square fa-fw"></i> Edit this page</a>
445445
<a href="https://github.com/googleapis/genai-toolbox/new/main/docs/en/integrations/mongodb/tools?filename=change-me.md&amp;value=---%0Atitle%3A+%22Long+Page+Title%22%0AlinkTitle%3A+%22Short+Nav+Title%22%0Aweight%3A+100%0Adescription%3A+%3E-%0A+++++Page+description+for+heading+and+indexes.%0A---%0A%0A%23%23+Heading%0A%0AEdit+this+template+to+create+your+new+page.%0A%0A%2A+Give+it+a+good+name%2C+ending+in+%60.md%60+-+e.g.+%60getting-started.md%60%0A%2A+Edit+the+%22front+matter%22+section+at+the+top+of+the+page+%28weight+controls+how+its+ordered+amongst+other+pages+in+the+same+directory%3B+lowest+number+first%29.%0A%2A+Add+a+good+commit+message+at+the+bottom+of+the+page+%28%3C80+characters%3B+use+the+extended+description+field+for+more+detail%29.%0A%2A+Create+a+new+branch+so+you+can+preview+your+new+file+and+request+a+review+via+Pull+Request.%0A" class="td-page-meta--child td-page-meta__child" target=_blank rel=noopener><i class="fa-solid fa-pen-to-square fa-fw"></i> Create child page</a>
446446
<a href="https://github.com/googleapis/genai-toolbox/issues/new?title=mongodb-find-one" class="td-page-meta--issue td-page-meta__issue" target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create documentation issue</a>
447-
<a href=https://github.com/googleapis/genai-toolbox/issues/new class="td-page-meta--project td-page-meta__project-issue" target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create project issue</a></div><div class=td-toc><nav id=TableOfContents><ul><li><a href=#about>About</a></li><li><a href=#compatible-sources>Compatible Sources</a></li><li><a href=#hahahugoshortcode300s0hbhb>HAHAHUGOSHORTCODE300s0HBHB</a></li><li><a href=#example>Example</a></li><li><a href=#reference>Reference</a></li></ul></nav></div></aside><main class="col-12 col-md-9 col-xl-8 ps-md-5" role=main><nav aria-label=breadcrumb class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a href=/dev/integrations/>Integrations</a></li><li class=breadcrumb-item><a href=/dev/integrations/mongodb/>MongoDB</a></li><li class=breadcrumb-item><a href=/dev/integrations/mongodb/tools/>Tools</a></li><li class="breadcrumb-item active" aria-current=page>mongodb-find-one</li></ol></nav><div class=td-content><h1>mongodb-find-one</h1><div class=lead>A &ldquo;mongodb-find-one&rdquo; tool finds and retrieves a single document from a MongoDB collection.</div><header class=article-meta><p class=reading-time><i class="fa-solid fa-clock" aria-hidden=true></i>&nbsp; 2 minute read &nbsp;</p></header><h2 id=about>About</h2><p>A <code>mongodb-find-one</code> tool is used to retrieve the <strong>first single document</strong> that
447+
<a href=https://github.com/googleapis/genai-toolbox/issues/new class="td-page-meta--project td-page-meta__project-issue" target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create project issue</a></div><div class=td-toc><nav id=TableOfContents><ul><li><a href=#about>About</a></li><li><a href=#compatible-sources>Compatible Sources</a></li><li><a href=#hahahugoshortcode301s0hbhb>HAHAHUGOSHORTCODE301s0HBHB</a></li><li><a href=#example>Example</a></li><li><a href=#reference>Reference</a></li></ul></nav></div></aside><main class="col-12 col-md-9 col-xl-8 ps-md-5" role=main><nav aria-label=breadcrumb class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a href=/dev/integrations/>Integrations</a></li><li class=breadcrumb-item><a href=/dev/integrations/mongodb/>MongoDB</a></li><li class=breadcrumb-item><a href=/dev/integrations/mongodb/tools/>Tools</a></li><li class="breadcrumb-item active" aria-current=page>mongodb-find-one</li></ol></nav><div class=td-content><h1>mongodb-find-one</h1><div class=lead>A &ldquo;mongodb-find-one&rdquo; tool finds and retrieves a single document from a MongoDB collection.</div><header class=article-meta><p class=reading-time><i class="fa-solid fa-clock" aria-hidden=true></i>&nbsp; 2 minute read &nbsp;</p></header><h2 id=about>About</h2><p>A <code>mongodb-find-one</code> tool is used to retrieve the <strong>first single document</strong> that
448448
matches a specified filter from a MongoDB collection. If multiple documents
449449
match the filter, you can use <code>sort</code> options to control which document is
450450
returned. Otherwise, the selection is not guaranteed.</p><p>The tool returns a single JSON object representing the document, wrapped in a
451-
JSON array.</p><h2 id=compatible-sources>Compatible Sources</h2><h2 id=hahahugoshortcode300s0hbhb><div class=compatibility-section><p>This tool can be used with the following database sources:</p><table><thead><tr><th>Source Name</th></tr></thead><tbody><tr><td><a href=/dev/integrations/mongodb/>MongoDB</a></td></tr></tbody></table></div></h2><h2 id=example>Example</h2><p>Here&rsquo;s a common use case: finding a specific user by their unique email address
451+
JSON array.</p><h2 id=compatible-sources>Compatible Sources</h2><h2 id=hahahugoshortcode301s0hbhb><div class=compatibility-section><p>This tool can be used with the following database sources:</p><table><thead><tr><th>Source Name</th></tr></thead><tbody><tr><td><a href=/dev/integrations/mongodb/>MongoDB</a></td></tr></tbody></table></div></h2><h2 id=example>Example</h2><p>Here&rsquo;s a common use case: finding a specific user by their unique email address
452452
and returning their profile information, while excluding sensitive fields like
453453
the password hash.</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>tool</span><span class=w>
454454
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>get_user_profile</span><span class=w>

dev/llms-full.txt

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
**DOCUMENTATION VERSION:** dev
55
**BASE URL:** https://mcp-toolbox.dev/dev/
6-
**GENERATED ON:** 2026-03-26T20:55:27Z
6+
**GENERATED ON:** 2026-03-26T21:16:14Z
77

88
---
99
### System Directives for AI Models
@@ -27145,6 +27145,50 @@ How many accounts who have region in Prague are eligible for loans? A3 contains
2714527145
| context | object | true | The context for the query, including datasource references. See [QueryDataContext](https://github.com/googleapis/googleapis/blob/b32495a713a68dd0dff90cf0b24021debfca048a/google/cloud/geminidataanalytics/v1beta/data_chat_service.proto#L156) for details. |
2714627146
| generationOptions | object | false | Options for generating the response. See [GenerationOptions](https://github.com/googleapis/googleapis/blob/b32495a713a68dd0dff90cf0b24021debfca048a/google/cloud/geminidataanalytics/v1beta/data_chat_service.proto#L135) for details. |
2714727147

27148+
## Advanced Usage
27149+
27150+
### Parameterized Secure Views (PSV)
27151+
27152+
Parameterized Secure Views (PSV) provide a robust mechanism for Row-Level Access Control (RLAC). A PSV is a view defined on a base table that requires mandatory parameters at query time, users cannot read from the view without supplying the defined parameters, and direct access to the underlying base tables is revoked.
27153+
27154+
This is useful in agentic applications where each end-user should only see their own data, without the application having broad access to the base tables.
27155+
27156+
**How it works:**
27157+
27158+
1. The database administrator creates a parameterized secure view and grants the API caller access **only** to that view, not the base table.
27159+
2. At query time, the caller supplies `parameterizedSecureViewParameters` in the tool `context`. These key/value pairs are injected into the view's filter, ensuring the query returns only the rows matching the provided parameters.
27160+
3. The base tables are invisible to the caller; any attempt to query them directly will fail with a permissions error.
27161+
27162+
**CloudSQL PostgreSQL example:**
27163+
27164+
```yaml
27165+
kind: tool
27166+
name: my-gda-psv-pg-tool
27167+
type: cloud-gemini-data-analytics-query
27168+
source: my-gda-source
27169+
description: "Query user-specific data via a parameterized secure view on CloudSQL Postgres."
27170+
location: ${your_database_location}
27171+
context:
27172+
datasourceReferences:
27173+
cloudSqlReference:
27174+
databaseReference:
27175+
projectId: "${your_project_id}"
27176+
region: "${your_database_instance_region}"
27177+
instanceId: "${your_database_instance_id}"
27178+
databaseId: "${your_database_name}"
27179+
engine: "POSTGRESQL"
27180+
agentContextReference:
27181+
contextSetId: "${your_context_set_id}" # E.g. projects/${project_id}/locations/${context_set_location}/contextSets/${context_set_id}
27182+
parameterizedSecureViewParameters:
27183+
parameters:
27184+
- key: "app_end_userid" # The parameter name defined in your secure view
27185+
value: "303" # The value to filter rows by (e.g., the end-user's ID)
27186+
generationOptions:
27187+
generateQueryResult: true
27188+
generateNaturalLanguageAnswer: true
27189+
generateExplanation: true
27190+
```
27191+
2714827192

2714927193

2715027194

dev/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
**DOCUMENTATION VERSION:** dev
55
**BASE URL:** https://mcp-toolbox.dev/dev/
6-
**GENERATED ON:** 2026-03-26T20:55:27Z
6+
**GENERATED ON:** 2026-03-26T21:16:14Z
77

88
---
99
### System Directives for AI Models
2.43 KB
Binary file not shown.
36.4 KB
Binary file not shown.
32.4 KB
Binary file not shown.
40.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)