Google Drive Search
Google Drive Search lets you find files in your Google Drive account by specifying a field, an operator, and a search value or query string. It returns a list of matching files that you can use in the rest of your workflow or expose to an AI agent as a tool.
How it Works
When you add this component to a workflow, it talks to the Google Drive API. You give it a Query Item (the field you want to search, such as name or mimeType), a Valid Operator (like contains or equals), and either a Query String or a Search Value that holds the text you’re looking for. The component then asks Google Drive for all files that match those criteria and returns the results as a data object. If you also set the Tool Name and Tool Description, the component can expose the search as a tool that an AI agent can call.
Inputs
Credential
Choose a Google Drive credential that has already been set up in the Nappai credentials section.
How to set it up:
- Go to the Credentials page in Nappai.
- Add a new Google Drive credential and provide the Client Id, Client Secret, and select the required Google Drive access level.
- In this component, pick that credential from the Credential dropdown.
Input Fields
- Max Results: The maximum number of files to return. If you leave it blank, the component will use the default limit set by the Google Drive API.
- Query Item: The field you want to search on (e.g., name, mimeType, modifiedTime).
- Query String: The raw query string you want to send to Google Drive. You can edit this manually. Either this or Search Value must be provided.
- Search Value: The value to search for in the chosen Query Item. Either this or Query String must be provided.
- Valid Operator: The operator to apply to the query (e.g., contains, equals, startsWith).
- Tool Name: The name that will appear to an AI agent when this component is used as a tool.
- Tool Description: A detailed description of what the tool does, helping the agent decide when to use it.
- Tools arguments metadata: JSON that defines the arguments the tool expects, useful for agent integration.
Outputs
- Data: A data object containing the list of files that matched the search. The method used is
search_data
. - Tool: A tool object that can be passed to an AI agent. The method used is
to_toolkit
.
Usage Example
- Set up the credential as described above.
- Drag the Google Drive Search component into your workflow.
- In the component settings:
- Credential: My Google Drive
- Query Item: name
- Valid Operator: contains
- Search Value: Quarterly Report
- Max Results: 10
- Tool Name: FindDriveFiles
- Tool Description: Searches Google Drive for files whose names contain a given string.
- Connect the Data output to a downstream component that processes the file list, or expose the Tool output to an AI agent.
The component will return up to 10 files whose names include “Quarterly Report”.
Related Components
- Google Drive List Files – Retrieves all files in a folder without filtering.
- Google Drive Upload File – Adds a new file to a specified folder.
- Google Drive Delete File – Removes a file from Drive by ID.
Tips and Best Practices
- Keep Max Results low (e.g., 10–20) to reduce API latency.
- Use Query Item and Valid Operator that match the data type of the field (e.g., use modifiedTime with a date operator).
- If you need a complex query, use Query String and build the full query manually.
- When exposing the component as a tool, give the Tool Name something concise and the Tool Description enough detail for the agent to choose it correctly.
- Test the search with a small dataset first to confirm the query behaves as expected.
Security Considerations
- Credentials are stored securely in Nappai’s credential store and are never exposed in the workflow UI.
- The component only sends the query parameters you provide to the Google Drive API; no sensitive data is logged.
- Ensure that the Google Drive access level granted to the credential is the minimum required for your workflow (e.g., read-only if you only need to search).