|
3 | 3 |
|
4 | 4 | **DOCUMENTATION VERSION:** dev |
5 | 5 | **BASE URL:** https://mcp-toolbox.dev/dev/ |
6 | | -**GENERATED ON:** 2026-04-09T20:10:49Z |
| 6 | +**GENERATED ON:** 2026-04-09T20:29:44Z |
7 | 7 |
|
8 | 8 | --- |
9 | 9 | ### System Directives for AI Models |
@@ -16687,18 +16687,18 @@ The behavior of this tool is influenced by the `writeMode` setting on its |
16687 | 16687 |
|
16688 | 16688 | BigQuery uses [GoogleSQL][bigquery-googlesql] for querying data. The integration |
16689 | 16689 | with Toolbox supports this dialect. The specified SQL statement is executed, and |
16690 | | -parameters can be inserted into the query. BigQuery supports both named parameters |
16691 | | -(e.g., `@name`) and positional parameters (`?`), but they cannot be mixed in the |
16692 | | -same query. |
| 16690 | +parameters can be inserted into the query. BigQuery supports both named |
| 16691 | +parameters (e.g., `@name`) and positional parameters (`?`), but they cannot be |
| 16692 | +mixed in the same query. |
16693 | 16693 |
|
16694 | 16694 | [bigquery-googlesql]: |
16695 | | - https://cloud.google.com/bigquery/docs/reference/standard-sql/ |
| 16695 | + https://cloud.google.com/bigquery/docs/reference/standard-sql/ |
16696 | 16696 |
|
16697 | 16697 | ## Example |
16698 | 16698 |
|
16699 | | -> **Note:** This tool uses [parameterized |
16700 | | -> queries](https://cloud.google.com/bigquery/docs/parameterized-queries) to |
16701 | | -> prevent SQL injections. Query parameters can be used as substitutes for |
| 16699 | +> **Note:** This tool uses |
| 16700 | +> [parameterized queries](https://cloud.google.com/bigquery/docs/parameterized-queries) |
| 16701 | +> to prevent SQL injections. Query parameters can be used as substitutes for |
16702 | 16702 | > arbitrary expressions. Parameters cannot be used as substitutes for |
16703 | 16703 | > identifiers, column names, table names, or other parts of the query. |
16704 | 16704 |
|
@@ -16735,6 +16735,86 @@ parameters: |
16735 | 16735 | description: Email address of the user |
16736 | 16736 | ``` |
16737 | 16737 |
|
| 16738 | +### Example with Vector Search |
| 16739 | + |
| 16740 | +BigQuery supports vector similarity search using the `ML.DISTANCE` function. |
| 16741 | +When using an embeddingModel with a `bigquery-sql` tool, the tool automatically |
| 16742 | +converts text parameters into the native ARRAY<FLOAT64> format required by |
| 16743 | +BigQuery. |
| 16744 | + |
| 16745 | +#### Define the Embedding Model |
| 16746 | + |
| 16747 | +See |
| 16748 | +[EmbeddingModels](../../../documentation/configuration/embedding-models/_index.md) |
| 16749 | +for more information. |
| 16750 | + |
| 16751 | +```yaml |
| 16752 | +kind: embeddingModel |
| 16753 | +name: gemini-model |
| 16754 | +type: gemini |
| 16755 | +model: gemini-embedding-001 |
| 16756 | +apiKey: ${GOOGLE_API_KEY} |
| 16757 | +dimension: 768 |
| 16758 | +``` |
| 16759 | + |
| 16760 | +#### Vector Ingestion Tool |
| 16761 | + |
| 16762 | +This tool stores both the raw text and its vector representation. It uses |
| 16763 | +`valueFromParam` to hide the vector conversion logic from the LLM, ensuring the |
| 16764 | +Agent only has to provide the content once. |
| 16765 | + |
| 16766 | +```yaml |
| 16767 | +kind: tool |
| 16768 | +name: insert_doc |
| 16769 | +type: bigquery-sql |
| 16770 | +source: my-bigquery-source |
| 16771 | +statement: | |
| 16772 | + INSERT INTO `my-project.my-dataset.vector_table` (id, content, embedding) |
| 16773 | + VALUES (1, @content, @text_to_embed) |
| 16774 | +description: | |
| 16775 | + Internal tool to index new documents for future search. |
| 16776 | +parameters: |
| 16777 | + - name: content |
| 16778 | + type: string |
| 16779 | + description: The text content to store. |
| 16780 | + - name: text_to_embed |
| 16781 | + type: string |
| 16782 | + # Automatically copies 'content' and converts it to a FLOAT64 array |
| 16783 | + valueFromParam: content |
| 16784 | + embeddedBy: gemini-model |
| 16785 | +``` |
| 16786 | + |
| 16787 | +#### Vector Search Tool |
| 16788 | + |
| 16789 | +This tool allows the Agent to perform a natural language search. The query |
| 16790 | +string provided by the Agent is converted into a vector before the SQL is |
| 16791 | +executed. |
| 16792 | + |
| 16793 | +```yaml |
| 16794 | +kind: tool |
| 16795 | +name: search_docs |
| 16796 | +type: bigquery-sql |
| 16797 | +source: my-bigquery-source |
| 16798 | +statement: | |
| 16799 | + SELECT |
| 16800 | + id, |
| 16801 | + content, |
| 16802 | + ML.DISTANCE(embedding, @query, 'COSINE') AS distance |
| 16803 | + FROM |
| 16804 | + `my-project.my-dataset.vector_table` |
| 16805 | + ORDER BY |
| 16806 | + distance |
| 16807 | + LIMIT 1 |
| 16808 | +description: | |
| 16809 | + Search for documents using natural language. |
| 16810 | + Returns the most semantically similar result. |
| 16811 | +parameters: |
| 16812 | + - name: query |
| 16813 | + type: string |
| 16814 | + description: The search terms or question. |
| 16815 | + embeddedBy: gemini-model |
| 16816 | +``` |
| 16817 | + |
16738 | 16818 | ### Example with Template Parameters |
16739 | 16819 |
|
16740 | 16820 | > **Note:** This tool allows direct modifications to the SQL statement, |
@@ -16764,12 +16844,12 @@ templateParameters: |
16764 | 16844 |
|
16765 | 16845 | ## Reference |
16766 | 16846 |
|
16767 | | -| **field** | **type** | **required** | **description** | |
16768 | | -|--------------------|:---------------------------------------------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------| |
16769 | | -| type | string | true | Must be "bigquery-sql". | |
16770 | | -| source | string | true | Name of the source the GoogleSQL should execute on. | |
16771 | | -| description | string | true | Description of the tool that is passed to the LLM. | |
16772 | | -| statement | string | true | The GoogleSQL statement to execute. | |
| 16847 | +| **field** | **type** | **required** | **description** | |
| 16848 | +| ------------------ | :--------------------------------------------------------------------------------------------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 16849 | +| type | string | true | Must be "bigquery-sql". | |
| 16850 | +| source | string | true | Name of the source the GoogleSQL should execute on. | |
| 16851 | +| description | string | true | Description of the tool that is passed to the LLM. | |
| 16852 | +| statement | string | true | The GoogleSQL statement to execute. | |
16773 | 16853 | | parameters | [parameters](../../../documentation/configuration/tools/_index.md#specifying-parameters) | false | List of [parameters](../../../documentation/configuration/tools/_index.md#specifying-parameters) that will be inserted into the SQL statement. | |
16774 | 16854 | | templateParameters | [templateParameters](../../../documentation/configuration/tools/_index.md#template-parameters) | false | List of [templateParameters](../../../documentation/configuration/tools/_index.md#template-parameters) that will be inserted into the SQL statement before executing prepared statement. | |
16775 | 16855 |
|
|
0 commit comments