> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Files

> Search for files and folders by name or content in a SharePoint document library or folder

Search for files and folders by name or content in a SharePoint document library or folder. Returns also a temp public download URL for each file that can be used for example to upload creatives to ads platforms.

|                      |                           |
| -------------------- | ------------------------- |
| **App**              | Microsoft SharePoint      |
| **Operation ID**     | `sharepoint_search_files` |
| **Type**             | Action                    |
| **Connection**       | `sharepoint` (required)   |
| **Credits per run**  | 1                         |
| **Agent / MCP tool** | Yes                       |

## Inputs

| Field         | Type                 | Required | Default | Description                                                                                                                                                    |
| ------------- | -------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `site`        | string or SelectItem | No       | -       | SharePoint site the document library belongs to, or 'me' for the user's own OneDrive.                                                                          |
| `drive`       | string or SelectItem | No       | -       | Document library (drive) to search in. Not needed when folder\_path is a full SharePoint link.                                                                 |
| `folder_path` | string               | No       | -       | Restrict the search to a folder: a path inside the library, e.g. 'Creative Ads/Q4', or a full SharePoint folder link. Leave empty to search the whole library. |
| `query`       | string               | Yes      | -       | Search text. Matches file and folder names, plus file content where the tenant's search index supports it, e.g. 'banner' or 'q4 report'.                       |
| `max_results` | integer              | No       | `25`    | Maximum number of results to return. Defaults to 25.                                                                                                           |

### SelectItem

| Field   | Type   | Required | Default | Description                                                                                          |
| ------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `value` | string | Yes      | -       | The value of the selectable item.                                                                    |
| `label` | string | Yes      | -       | The label of the selectable item, used for display purposes. If not provided, defaults to the value. |

## Output

**Type**: `List[Dict]`

Returns the matching files and folders.

**Fields**: `file_id`, `file_name`, `file_url`, `file_type`, `is_folder`, `size`, `modified_at`, `download_url`
