Add a knowledge source
cs_add_knowledge_sourceAdd a knowledge source to a Copilot Studio agent by generating YAML definitions for public sites, SharePoint folders, Graph connectors, or file uploads. Preview changes first, then confirm to write.
Instructions
Add knowledge as YAML: kind 'public-site' (Bing-scoped website, max 2 path levels), 'sharepoint' (direct folder URL), 'graph-connector' (Microsoft Graph connector via environment variable), or 'files' (copy documents into knowledge/files for upload on push). Dataverse, AI Search and SQL knowledge are portal-only. The first call changes nothing: it returns the files it would write, as a diff against what is there now, for the user to approve. Call it again with the same arguments plus confirm: true to write them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| name | Yes | ||
| site | No | ||
| files | No | Absolute paths of documents (pdf, docx, txt, ...) | |
| confirm | No | Required to write the change to the file. Without it the tool returns a preview - the changed lines against the current ones, and the character count - and writes nothing. | |
| overwrite | No | ||
| workspace | No | Path to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory. | |
| description | No | ||
| connectionName | No | ||
| includeSubPages | No | ||
| triggerCondition | No | Power Fx condition restricting when this source is searched | |
| contentSourceDisplayName | No | ||
| connectionEnvironmentVariable | No |