# Search User Files

`Search_User_Files` is the GovTribe MCP dataset tool for searching team-uploaded files in workspace capture workflows; if content beyond `content_snippet` is needed, call `Documentation` with `article_names=["Vector_Store_Content_Retrieval_Guide"]`, then use `Add_To_Vector_Store` and `Search_Vector_Store`.

## When To Use

Typical questions this tool answers well:

* Which internal file in our workspace matches this exact GovTribe file ID?
* What uploaded files mention a specific topic or phrase across file content?
* Which team files are tied to a specific opportunity, IDV, jurisdiction, or state context?
* How can I pull a compact file set first, then run deeper content retrieval in a vector store?
* How can I return metadata-only search result identifiers before requesting row payloads?

## Required Reading

1. [Search\_Mode\_And\_Query\_Guide](/user-guide/mcp/guides/search_mode_and_query_guide.md): Required before setting free-text query strings and choosing keyword vs semantic retrieval.

## Output Contract

* Top-level keys:
  * `current_page`: Current page number when `per_page > 0`.
  * `data`: Array of result rows when `per_page > 0`.
  * `from`: First row position in the current page.
  * `last_page`: Last page number for current filters.
  * `path`: GovTribe search URL for this result set.
  * `per_page`: Applied page size.
  * `to`: Last row position in the current page.
  * `total`: Total matched row count for current query filters.
  * `contains`: Dataset label for the returned result set.
  * `search_results_id_can_generate_saved_search`: Saved-search eligibility flag.
  * `search_results_id`: Server-side search result identifier.
  * `view_search_results_url`: URL to open this exact result set.
  * `per_page: 0 behavior`: returns metadata keys above without `data` and page-window keys.
* Row keys:
  * `govtribe_id`
  * `govtribe_ai_summary`
  * `govtribe_type`
  * `govtribe_url`
  * `content`
  * `created_at`
  * `description`
  * `download_url`
  * `content_snippet`
  * `name`
  * `size`
  * `updated_at`
* Relationship retrieval map:
  * `none`: This resource has no relationship fields.

## Usage Patterns

Pattern A: Resolve one known user file by GovTribe file ID. Tool: `Search_User_Files`

```json
{
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 1,
  "user_file_ids": [
    "<USER_FILE_ID>"
  ],
  "user_file_ids_operator": "in"
}
```

Pattern B: Semantic exploration for concept-level internal file discovery. Tool: `Search_User_Files`

```json
{
  "query": "intelligence analyst support statement of work",
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 5
}
```

Pattern C: Find files similar to a known file-like entity. Tool: `Search_User_Files`

```json
{
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "similar_filter": {
    "govtribe_type": "user_file",
    "govtribe_id": "<USER_FILE_ID>"
  },
  "page": 1,
  "per_page": 10
}
```

Pattern D: Metadata-only call to get totals and result-set identifiers. Tool: `Search_User_Files`

```json
{
  "search_mode": "keyword",
  "page": 1,
  "per_page": 0
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.govtribe.com/user-guide/mcp/tools/search-user-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
