Tool: import_rag_files
Imports files into a RagCorpus from Cloud Storage or Google Drive. This is a long-running operation. Format: 'projects/{project_id}/locations/{region}/ragCorpora/{rag_corpus_id}'. CRITICAL: For {region}, use the region specified in the current context window. If no region is specified, prompt the user to provide one. Do not use 'global'.
The following sample demonstrate how to use curl to invoke the import_rag_files MCP tool.
| Curl Request |
|---|
curl --location 'https://aiplatform.googleapis.com/mcp/generate' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "import_rag_files", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for VertexRagDataService.ImportRagFiles.
ImportRagFilesRequest
| JSON representation |
|---|
{
"parent": string,
"importRagFilesConfig": {
object ( |
| Fields | |
|---|---|
parent |
Required. The name of the RagCorpus resource into which to import files. Format: |
importRagFilesConfig |
Required. The config for the RagFiles to be synced and imported into the RagCorpus. |
ImportRagFilesConfig
| JSON representation |
|---|
{ "ragFileTransformationConfig": { object ( |
| Fields | |
|---|---|
ragFileTransformationConfig |
Specifies the transformation config for RagFiles. |
ragFileParsingConfig |
Optional. Specifies the parsing config for RagFiles. RAG will use the default parser if this field is not set. |
maxEmbeddingRequestsPerMin |
Optional. The max number of queries per minute that this job is allowed to make to the embedding model specified on the corpus. This value is specific to this job and not shared across other import jobs. Consult the Quotas page on the project to set an appropriate value here. If unspecified, a default value of 1,000 QPM would be used. |
rebuildAnnIndex |
Rebuilds the ANN index to optimize for recall on the imported data. Only applicable for RagCorpora running on RagManagedDb with Default is false, i.e., index is not rebuilt. |
Union field import_source. The source of the import. import_source can be only one of the following: |
|
gcsSource |
Google Cloud Storage location. Supports importing individual files as well as entire Google Cloud Storage directories. Sample formats: - |
googleDriveSource |
Google Drive location. Supports importing individual files as well as Google Drive folders. |
slackSource |
Slack channels with their corresponding access tokens. |
jiraSource |
Jira queries with their corresponding authentication. |
sharePointSources |
SharePoint sources. |
Union field partial_failure_sink. Optional. If provided, all partial failures are written to the sink. Deprecated. Prefer to use the import_result_sink. partial_failure_sink can be only one of the following: |
|
partialFailureGcsSink |
The Cloud Storage path to write partial failures to. Deprecated. Prefer to use |
partialFailureBigquerySink |
The BigQuery destination to write partial failures to. It should be a bigquery table resource name (e.g. "bq://projectId.bqDatasetId.bqTableId"). The dataset must exist. If the table does not exist, it will be created with the expected schema. If the table exists, the schema will be validated and data will be added to this existing table. Deprecated. Prefer to use |
Union field import_result_sink. Optional. If provided, all successfully imported files and all partial failures are written to the sink. import_result_sink can be only one of the following: |
|
importResultGcsSink |
The Cloud Storage path to write import result to. |
importResultBigquerySink |
The BigQuery destination to write import result to. It should be a bigquery table resource name (e.g. "bq://projectId.bqDatasetId.bqTableId"). The dataset must exist. If the table does not exist, it will be created with the expected schema. If the table exists, the schema will be validated and data will be added to this existing table. |
GcsSource
| JSON representation |
|---|
{ "uris": [ string ] } |
| Fields | |
|---|---|
uris[] |
Required. Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more information on wildcards, see https://cloud.google.com/storage/docs/wildcards. |
GoogleDriveSource
| JSON representation |
|---|
{
"resourceIds": [
{
object ( |
| Fields | |
|---|---|
resourceIds[] |
Required. Google Drive resource IDs. |
ResourceId
| JSON representation |
|---|
{
"resourceType": enum ( |
| Fields | |
|---|---|
resourceType |
Required. The type of the Google Drive resource. |
resourceId |
Required. The ID of the Google Drive resource. |
SlackSource
| JSON representation |
|---|
{
"channels": [
{
object ( |
| Fields | |
|---|---|
channels[] |
Required. The Slack channels. |
SlackChannels
| JSON representation |
|---|
{ "channels": [ { object ( |
| Fields | |
|---|---|
channels[] |
Required. The Slack channel IDs. |
apiKeyConfig |
Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Slack channel access token that has access to the slack channel IDs. See: https://api.slack.com/tutorials/tracks/getting-a-token. |
SlackChannel
| JSON representation |
|---|
{ "channelId": string, "startTime": string, "endTime": string } |
| Fields | |
|---|---|
channelId |
Required. The Slack channel ID. |
startTime |
Optional. The starting timestamp for messages to import. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime |
Optional. The ending timestamp for messages to import. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos |
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
ApiKeyConfig
| JSON representation |
|---|
{ "apiKeySecretVersion": string, "apiKeyString": string } |
| Fields | |
|---|---|
apiKeySecretVersion |
Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version} |
apiKeyString |
The API key string. Either this or |
JiraSource
| JSON representation |
|---|
{
"jiraQueries": [
{
object ( |
| Fields | |
|---|---|
jiraQueries[] |
Required. The Jira queries. |
JiraQueries
| JSON representation |
|---|
{
"projects": [
string
],
"customQueries": [
string
],
"email": string,
"serverUri": string,
"apiKeyConfig": {
object ( |
| Fields | |
|---|---|
projects[] |
A list of Jira projects to import in their entirety. |
customQueries[] |
A list of custom Jira queries to import. For information about JQL (Jira Query Language), see https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/ |
email |
Required. The Jira email address. |
serverUri |
Required. The Jira server URI. |
apiKeyConfig |
Required. The SecretManager secret version resource name (e.g. projects/{project}/secrets/{secret}/versions/{version}) storing the Jira API key. See Manage API tokens for your Atlassian account. |
| JSON representation |
|---|
{
"sharePointSources": [
{
object ( |
| Fields | |
|---|---|
sharePointSources[] |
The SharePoint sources. |
| JSON representation |
|---|
{ "clientId": string, "clientSecret": { object ( |
| Fields | |
|---|---|
clientId |
The Application ID for the app registered in Microsoft Azure Portal. The application must also be configured with MS Graph permissions "Files.ReadAll", "Sites.ReadAll" and BrowserSiteLists.Read.All. |
clientSecret |
The application secret for the app registered in Azure. |
tenantId |
Unique identifier of the Azure Active Directory Instance. |
sharepointSiteName |
The name of the SharePoint site to download from. This can be the site name or the site id. |
fileId |
Output only. The SharePoint file id. Output only. |
Union field folder_source. The SharePoint folder source. If not provided, uses "root". folder_source can be only one of the following: |
|
sharepointFolderPath |
The path of the SharePoint folder to download from. |
sharepointFolderId |
The ID of the SharePoint folder to download from. |
Union field drive_source. The SharePoint drive source. drive_source can be only one of the following: |
|
driveName |
The name of the drive to download from. |
driveId |
The ID of the drive to download from. |
GcsDestination
| JSON representation |
|---|
{ "outputUriPrefix": string } |
| Fields | |
|---|---|
outputUriPrefix |
Required. Google Cloud Storage URI to output directory. If the uri doesn't end with '/', a '/' will be automatically appended. The directory is created if it doesn't exist. |
BigQueryDestination
| JSON representation |
|---|
{ "outputUri": string } |
| Fields | |
|---|---|
outputUri |
Required. BigQuery URI to a project or table, up to 2000 characters long. When only the project is specified, the Dataset and Table is created. When the full table reference is specified, the Dataset must exist and table must not exist. Accepted forms:
|
RagFileTransformationConfig
| JSON representation |
|---|
{
"ragFileChunkingConfig": {
object ( |
| Fields | |
|---|---|
ragFileChunkingConfig |
Specifies the chunking config for RagFiles. |
RagFileChunkingConfig
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field chunking_config. Specifies the chunking config for RagFiles. chunking_config can be only one of the following: |
|
fixedLengthChunking |
Specifies the fixed length chunking config. |
FixedLengthChunking
| JSON representation |
|---|
{ "chunkSize": integer, "chunkOverlap": integer } |
| Fields | |
|---|---|
chunkSize |
The size of the chunks. |
chunkOverlap |
The overlap between chunks. |
RagFileParsingConfig
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field parser. The parser to use for RagFiles. parser can be only one of the following: |
|
layoutParser |
The Layout Parser to use for RagFiles. |
llmParser |
The LLM Parser to use for RagFiles. |
LayoutParser
| JSON representation |
|---|
{ "processorName": string, "maxParsingRequestsPerMin": integer } |
| Fields | |
|---|---|
processorName |
The full resource name of a Document AI processor or processor version. The processor must have type |
maxParsingRequestsPerMin |
The maximum number of requests the job is allowed to make to the Document AI processor per minute. Consult https://cloud.google.com/document-ai/quotas and the Quota page for your project to set an appropriate value here. If unspecified, a default value of 120 QPM would be used. |
LlmParser
| JSON representation |
|---|
{ "modelName": string, "maxParsingRequestsPerMin": integer, "customParsingPrompt": string } |
| Fields | |
|---|---|
modelName |
The name of a LLM model used for parsing. Format: * |
maxParsingRequestsPerMin |
The maximum number of requests the job is allowed to make to the LLM model per minute. Consult https://cloud.google.com/vertex-ai/generative-ai/docs/quotas and your document size to set an appropriate value here. If unspecified, a default value of 5000 QPM would be used. |
customParsingPrompt |
The prompt to use for parsing. If not specified, a default prompt will be used. |
ResourceType
The type of the Google Drive resource.
| Enums | |
|---|---|
RESOURCE_TYPE_UNSPECIFIED |
Unspecified resource type. |
RESOURCE_TYPE_FILE |
File resource type. |
RESOURCE_TYPE_FOLDER |
Folder resource type. |
Output Schema
This resource represents a long-running operation that is the result of a network API call.
Operation
| JSON representation |
|---|
{ "name": string, "metadata": { "@type": string, field1: ..., ... }, "done": boolean, // Union field |
| Fields | |
|---|---|
name |
The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the |
metadata |
Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. An object containing fields of an arbitrary type. An additional field |
done |
If the value is |
Union field result. The operation result, which can be either an error or a valid response. If done == false, neither error nor response is set. If done == true, exactly one of error or response can be set. Some services might not provide the result. result can be only one of the following: |
|
error |
The error result of the operation in case of failure or cancellation. |
response |
The normal, successful response of the operation. If the original method returns no data on success, such as An object containing fields of an arbitrary type. An additional field |
Any
| JSON representation |
|---|
{ "typeUrl": string, "value": string } |
| Fields | |
|---|---|
typeUrl |
Identifies the type of the serialized Protobuf message with a URI reference consisting of a prefix ending in a slash and the fully-qualified type name. Example: type.googleapis.com/google.protobuf.StringValue This string must contain at least one The prefix is arbitrary and Protobuf implementations are expected to simply strip off everything up to and including the last All type URL strings must be legal URI references with the additional restriction (for the text format) that the content of the reference must consist only of alphanumeric characters, percent-encoded escapes, and characters in the following set (not including the outer backticks): In the original design of |
value |
Holds a Protobuf serialization of the type described by type_url. A base64-encoded string. |
Status
| JSON representation |
|---|
{ "code": integer, "message": string, "details": [ { "@type": string, field1: ..., ... } ] } |
| Fields | |
|---|---|
code |
The status code, which should be an enum value of |
message |
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the |
details[] |
A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌