Skip to content

File Search: Maximum of 5 FileSearchStores in file_search_store_names? Documentation and Limits Clarification #2074

@motomura-s

Description

@motomura-s

Description

Hi team,

I’m using the Gemini API File Search tool with the Python SDK (google-genai==1.56.0).
When I include more than five FileSearchStore names in file_search_store_names, I consistently get a client validation error. I couldn’t find any documentation explaining this limit.

What I'm trying to do

I’m trying to query multiple File Search stores in a single generate_content call by specifying multiple store names:

from google import genai
from google.genai import types

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3-flash-preview",
    contents="Example query",
    config=types.GenerateContentConfig(
        tools=[
            types.Tool(
                file_search=types.FileSearch(
                    file_search_store_names=[
                        "fileSearchStores/store1",
                        "fileSearchStores/store2",
                        "fileSearchStores/store3",
                        "fileSearchStores/store4",
                        "fileSearchStores/store5",
                        "fileSearchStores/store6",
                    ]
                )
            )
        ]
    )
)

Error Message

google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].file_search.file_search_store_names: [FIELD_INVALID] Max 5 corpora can be specified\n', 'status': 'INVALID_ARGUMENT'}}

Questions

  1. Is there any official documentation describing the limit on the number of file_search_store_names
    that can be specified? If so, where is this limit described?

  2. Is there a plan to increase this limit beyond 5 stores per request?

Metadata

Metadata

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions