Skip to main content
Glama

Search Workspace

search_workspace
Read-onlyIdempotent

Search Drive, contacts, and Gmail with one query to locate files, people, or messages when the right service is unclear.

Instructions

Search Drive, the user's saved contacts and Gmail with one query, for a first look when the right service is unclear. Drive matches names and content (name matches first, no shared drives); Gmail takes Gmail query syntax and each hit is read in one metadata request. For full queries and paging use drive_list_files, people_search_contacts or gmail_search_emails. Returns matches (service, id, kind, resource; Drive name, mime_type, modified_at, web_url; contact name, email; Gmail thread_id, subject, from, date, snippet, unread), count, account_timezone and errors per failed service; the call fails only when every service fails.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_workspace"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesSearch text, must not be blank. Drive matches it against file names and content (fullText contains, plus name contains for name prefixes), contacts by prefix of names, emails, phone numbers or organizations, and Gmail treats it as a Gmail search query, e.g. 'from:alice invoice'.
servicesNoServices to search: any of 'drive', 'people' (the user's saved contacts) and 'gmail'; omit to search all three.
max_results_per_serviceNoMaximum hits from each searched service, 1 to 25.

Output Schema

NameRequiredDescriptionDefault
countNoNumber of items in this response.
queryNo
errorsNo
matchesNo
has_moreNoWhether another page is available.
servicesNo
fetched_atNoRFC3339 time when this response was fetched.
next_page_tokenNoOpaque token for the next page, or null.
account_timezoneNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changedv2.1.0
    • removedInput schema / maxProperties
      Removed value: -10000
    • changedInput schema / properties / max_results_per_service / description
      Previous value: -"Maximum results per service to include in the result."New value: +"Maximum hits from each searched service, 1 to 25."
    • changedInput schema / properties / query / description
      Previous value: -"Search or filter expression used to narrow the results."New value: +"Search text, must not be blank. Drive matches it against file names and content (fullText contains, plus name contains for name prefixes), contacts by prefix of names, emails, phone numbers or organizations, and Gmail treats it as a Gmail search query, e.g. 'from:alice invoice'."
    • removedInput schema / properties / query / maxLength
      Removed value: -1000000
    • removedInput schema / properties / services / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "maxLength": 1000000,
      -      "type": "string"
      -    },
      -    "maxItems": 10000,
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / services / default
      Removed value: -null
    • changedInput schema / properties / services / description
      Previous value: -"Subset of services to search: any of 'drive', 'people', 'gmail'; omit to search all three."New value: +"Services to search: any of 'drive', 'people' (the user's saved contacts) and 'gmail'; omit to search all three."
    • addedInput schema / properties / services / items
      Added value: +{
      +  "enum": [
      +    "drive",
      +    "people",
      +    "gmail"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / services / type
      Added value: +"array"
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
    • removedOutput schema / description
      Removed value: -"Structured response returned by this MCP tool."
    • addedOutput schema / properties / account_timezone
      Added value: +{}
    • removedOutput schema / properties / errors / description
      Removed value: -"Response field: errors."
    • removedOutput schema / properties / matches / description
      Removed value: -"Response field: matches."
    • removedOutput schema / properties / query / description
      Removed value: -"Response field: query."
    • removedOutput schema / properties / resource
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "Stable cross-tool Workspace resource handle when applicable.",
      -  "properties": {
      -    "etag": {
      -      "description": "Provider entity tag.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "id": {
      -      "description": "Provider resource identifier.",
      -      "type": "string"
      -    },
      -    "kind": {
      -      "description": "Workspace resource kind.",
      -      "type": "string"
      -    },
      -    "mime_type": {
      -      "description": "MIME type when applicable.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "modified_at": {
      -      "description": "Last modification time.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "name": {
      -      "description": "Human-readable name.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "uri": {
      -      "description": "Stable Workspace resource URI.",
      -      "type": "string"
      -    },
      -    "web_url": {
      -      "description": "Provider web URL.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "required": [
      -    "kind",
      -    "id",
      -    "uri"
      -  ],
      -  "type": "object"
      -}
    • removedOutput schema / properties / services / description
      Removed value: -"Response field: services."
    • removedOutput schema / properties / services / items
      Removed value: -{}
    • removedOutput schema / properties / services / type
      Removed value: -"array"
    • removedOutput schema / properties / status
      Removed value: -{
      -  "description": "Machine-readable operation status.",
      -  "type": "string"
      -}
    • removedOutput schema / title
      Removed value: -"Search Workspace response"
  2. First observedv0.3.7

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent and open-world, but the description adds real operational context: Drive ranks name matches first and excludes shared drives, Gmail hits cost one metadata request each, and the call degrades gracefully (fails only if every service fails). That partial-failure semantics is the kind of behavior annotations cannot express.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads scope, then matching behavior, then sibling routing, then return shape — a logical order with no filler. It is dense and long for a single paragraph, but nearly every clause carries new information; only the return-value enumeration is partially redundant with the output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers scope, per-service matching semantics, cost per hit, partial-failure behavior, and result fields, which is everything needed to call a three-service fan-out search correctly. Since an output schema exists, the return summary is a bonus rather than a requirement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds value by clarifying Drive's matching model ('name matches first, no shared drives') and the Gmail query-syntax treatment of the query string. It does not restate the max_results bound or the services enum, which the schema already covers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and three resources ('Search Drive, the user's saved contacts and Gmail with one query') and immediately differentiates itself from the per-service siblings. An agent can tell exactly what this tool spans without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the selecting condition ('for a first look when the right service is unclear') and names the exact alternatives for deeper use: drive_list_files, people_search_contacts, gmail_search_emails, with the reason 'full queries and paging'. Explicit when-to-use and when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.