microsoft-sharepoint
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMicrosoft SharePoint
Microsoft SharePoint
<!-- BEGIN:skill-intro -->
Agent-callable tools for Microsoft SharePoint Online, over the Microsoft Graph API v1.0 (): find sites and document libraries; browse, search, upload, download, move, copy, and share files and folders; manage SharePoint lists and list items; and author and publish site pages. 32 scripts across sites, drives, files & folders, sharing & permissions, lists, list items, and pages. Read-only navigation tools resolve the ids (, , , , column internal names) that the write tools require — a site is addressed by an opaque composite id you get from /, never constructed by hand.
<!-- legal:disclaimer -->
https://graph.microsoft.com/v1.0/sites/...siteIddriveIdlistIdpageIdfindSitesgetSiteIndependent, unofficial connector for Microsoft SharePoint. Not affiliated with, endorsed by, or sponsored by Microsoft SharePoint. "Microsoft SharePoint" is a trademark of its owner, used only to identify the service this connector works with.
<!-- /legal:disclaimer -->
<!-- END:skill-intro --><!-- BEGIN:skill-intro -->
可由Agent调用的Microsoft SharePoint Online工具,基于Microsoft Graph API v1.0():查找网站和文档库;浏览、搜索、上传、下载、移动、复制和共享文件及文件夹;管理SharePoint列表和列表项;创作并发布网站页面。涵盖网站、驱动器、文件与文件夹、共享与权限、列表、列表项和页面的32个脚本。只读导航工具可解析写入工具所需的ID(、、、、列内部名称)——网站通过从/获取的不透明复合ID寻址,切勿手动构造。
<!-- legal:disclaimer -->
https://graph.microsoft.com/v1.0/sites/...siteIddriveIdlistIdpageIdfindSitesgetSite独立、非官方的Microsoft SharePoint连接器。与Microsoft SharePoint无关联、未获其认可或赞助。“Microsoft SharePoint”是其所有者的商标,仅用于标识此连接器所适配的服务。
<!-- /legal:disclaimer -->
<!-- END:skill-intro -->When to use this
何时使用此工具
<!-- BEGIN:skill-use-cases -->
- An agent needs to find or read SharePoint content — search sites, list a site's document libraries, browse or search files and folders, or read a file's / list-item's / page's details.
- An agent needs to work with files — create folders, upload text or binary files, move / copy / rename, export to PDF or HTML, or share (links and per-person grants) and manage permissions.
- An agent needs to work with lists — list a site's lists, discover a list's columns, create lists, and create / read / update / delete list items.
- An agent needs to author pages — create a draft site page (optionally with text body content) and publish it.
<!-- BEGIN:skill-use-cases -->
- Agent需要查找或读取SharePoint内容——搜索网站、列出网站的文档库、浏览或搜索文件和文件夹,或读取文件/列表项/页面的详细信息。
- Agent需要处理文件——创建文件夹、上传文本或二进制文件、移动/复制/重命名、导出为PDF或HTML,或共享(链接和个人权限授予)并管理权限。
- Agent需要处理列表——列出网站的列表、发现列表的列、创建列表,以及创建/读取/更新/删除列表项。
- Agent需要创作页面——创建草稿网站页面(可选择添加文本正文内容)并发布。
Setup
安装设置
This is an agentskills.io skill.
If the connector has not been installed as a skill yet, install it first with (or your harness's own skill-install mechanism), then continue here. Installing the skill copies these files, not dependencies. Before running the CLI, a local MCP server, or auth commands, run here once. Importing the published package as a dependency in your own project instead? That already resolves everything — see .
npx skills add zapier/connectors --skill microsoft-sharepointzapier-sdknpm install --omit=devnpm installreferences/use-as-sdk.mdThe connector runs on Node.js 22.18+. Pick the reference that matches how you're running it, and load it before doing anything else:
| You have... | Load |
|---|---|
An MCP-aware client — tools may already be loaded (e.g. | |
Terminal / subprocess access (you can run | |
| Only your own code, importing this package as a dependency | |
| No tool access, no terminal, no ability to import this package — you write your own code that calls the Microsoft SharePoint API directly (e.g. a code-execution sandbox) | |
这是一款agentskills.io技能。
如果尚未将该连接器作为技能安装,请先使用(或你的 harness 自带的技能安装机制)进行安装,然后继续后续步骤。安装技能会复制这些文件,但不会复制依赖项。运行CLI、本地MCP服务器或认证命令之前,请在此处运行一次。如果是在你自己的项目中导入已发布的包作为依赖?那么已经解决了所有依赖问题——请参阅。
npx skills add zapier/connectors --skill microsoft-sharepointzapier-sdknpm install --omit=devnpm installreferences/use-as-sdk.md该连接器运行于Node.js 22.18+。选择与你的运行方式匹配的参考文档,并在进行任何操作前加载它:
| 你拥有... | 加载方式 |
|---|---|
支持MCP的客户端——工具可能已加载(例如 | |
终端/子进程访问权限(可运行 | |
| 仅使用自有代码,将此包作为依赖导入 | |
| 无工具访问权限、无终端、无法导入此包——你编写自己的代码直接调用Microsoft SharePoint API(例如代码执行沙箱) | |
Scripts
脚本
<!-- BEGIN:skill-connections-note? -->
<!-- END:skill-scripts-table -->
<!-- BEGIN:disambiguation-and-refusals? -->
All scripts use the single connection , except , which needs no connection (it polls a pre-authenticated monitor URL).
<!-- END:skill-connections-note -->
<!-- BEGIN:skill-scripts-table -->
microsoft-sharepointgetCopyStatus| Script | Script name | Connections | Description |
|---|---|---|---|
| | | Search sites by keyword; the primary site-discovery entry point. |
| | | Get a site by composite id, |
| | | List a site's document libraries to resolve a |
| | | List the direct children of a folder or a drive root. |
| | | Search files and folders by name/content within a drive. |
| | | Get a file or folder's metadata (with a download URL) by id. |
| | | Create a folder at the root or inside another folder. |
| | | Create a small text file from string content. |
| | | Upload a binary file from a source URL (handles large files). |
| | | Replace an existing file's contents from a source URL. |
| | | Move / rename an item within the same document library. |
| | | Copy a file/folder to another folder or drive (async). |
| | (none) | Poll the status of an async copy started by |
| | | Delete a file or folder (moves it to the recycle bin). |
| | | Download a file converted to PDF / HTML / JPG / GLB. |
| | | Create a shareable link (view/edit/embed) to an item. |
| | | Grant named people read/write access to an item. |
| | | List the permissions on a file or folder. |
| | | Revoke a permission from a file or folder. |
| | | List a site's lists (also serves single-list lookup). |
| | | Create a new list in a site. |
| | | List a list's column definitions (internal field names). |
| | | List or filter items in a list, with column values. |
| | | Get a single list item with its column values. |
| | | Create a new item in a list. |
| | | Update column values on an existing list item. |
| | | Delete a list item (hard delete, not the recycle bin). |
| | | List a site's pages to resolve a |
| | | Get a single site page by id. |
| | | Create a draft site page, optionally with text content. |
| | | Publish a draft site page. |
| | | Delete a site page (moves it to the recycle bin). |
<!-- BEGIN:skill-connections-note? -->
<!-- END:skill-scripts-table -->
<!-- BEGIN:disambiguation-and-refusals? -->
所有脚本均使用单个连接,除了,它不需要连接(轮询预认证的监控URL即可)。
<!-- END:skill-connections-note -->
<!-- BEGIN:skill-scripts-table -->
microsoft-sharepointgetCopyStatus| 脚本 | 脚本名称 | 连接 | 描述 |
|---|---|---|---|
| | | 按关键词搜索网站;主要的网站发现入口。 |
| | | 通过复合ID、 |
| | | 列出网站的文档库以解析 |
| | | 列出文件夹或驱动器根目录的直接子项。 |
| | | 在驱动器内按名称/内容搜索文件和文件夹。 |
| | | 通过ID获取文件或文件夹的元数据(含下载URL)。 |
| | | 在根目录或其他文件夹内创建文件夹。 |
| | | 从字符串内容创建小型文本文件。 |
| | | 从源URL上传二进制文件(支持大文件)。 |
| | | 从源URL替换现有文件的内容。 |
| | | 在同一文档库内移动/重命名项。 |
| | | 将文件/文件夹复制到其他文件夹或驱动器(异步)。 |
| | (none) | 轮询由 |
| | | 删除文件或文件夹(移至回收站)。 |
| | | 下载转换为PDF/HTML/JPG/GLB格式的文件。 |
| | | 创建项的可共享链接(查看/编辑/嵌入)。 |
| | | 授予指定人员对项的读/写权限。 |
| | | 列出文件或文件夹的权限。 |
| | | 撤销文件或文件夹的某项权限。 |
| | | 列出网站的列表(也支持单列表查找)。 |
| | | 在网站中创建新列表。 |
| | | 列出列表的列定义(内部字段名称)。 |
| | | 列出或筛选列表中的项及列值。 |
| | | 获取单个列表项及其列值。 |
| | | 在列表中创建新项。 |
| | | 更新现有列表项的列值。 |
| | | 删除列表项(硬删除,不进入回收站)。 |
| | | 列出网站的页面以解析 |
| | | 通过ID获取单个网站页面。 |
| | | 创建草稿网站页面,可选择添加文本内容。 |
| | | 发布草稿网站页面。 |
| | | 删除网站页面(移至回收站)。 |
Disambiguation & refusals
歧义消除与操作拒绝
Disambiguation before a write. Before writing to something you looked up by name — a site from , a list from , or a list item from — count the exact case-insensitive name matches:
findSiteslistListsfindListItems- Exactly one match — act on it. Don't over-ask; a single unambiguous match is the answer.
- Two or more that tie — stop. List the tied candidates with a distinguishing field (,
webUrl, orid) and ask which one the user means. Don't pick arbitrarily, and don't write to all of them. Site names in particular collide across departments (e.g. two "Marketing" sites).lastModifiedDateTime
Unsupported operations — say so and stop; don't fake it with another tool. This catalog deliberately does not:
- Move a file across libraries or sites (no native move). is same-library only. The only way to relocate across libraries/sites is
moveItem→ (copyItem) →getCopyStatus, which is lossy: the copy gets a new id and URL, its sharing links and permissions don't carry over, and a half-failed copy can lose the file. You may perform this relocation when asked to move a file elsewhere, but never present it as a plain "move": warn the user first that it's a copy-then-delete, tell them the file's URL/id changes and sharing links & permissions won't carry over, confirm the copy succeeded viadeleteItembefore deleting the original, and report the new location. Never silently copy-delete and report a completed move.getCopyStatus - Edit an existing page's body, or add non-text web parts (images, embeds, quick-links, multi-column layouts). authors a single text web part on a new page; editing an existing page's content and rich web parts are out of scope. Do not delete the page and recreate it to simulate an edit — that changes the page's id/URL and loses its version history, comments, and permissions. Tell the user in-place body editing isn't supported and stop.
createPage - Enumerate every site in the tenant. There is no "list all sites" — a delegated token can't. Use (keyword) or
findSiteswith a known path.getSite - Manage content types, site columns, term-store metadata, or triggers (new-file / new-item notifications). These aren't exposed.
- Write person/group or multi-value lookup columns on list items. Those column types are read-only here.
If asked for any of these, tell the user it's unsupported and stop — don't reach for an unrelated tool to approximate it.
<!-- END:disambiguation-and-refusals -->写入前的歧义消除。在对通过名称查找的内容(来自的网站、来自的列表或来自的列表项)执行写入操作前,请统计完全匹配(不区分大小写)的名称数量:
findSiteslistListsfindListItems- 恰好一个匹配项——执行操作。无需额外询问;唯一明确的匹配项即为目标。
- 两个或多个并列匹配项——停止操作。列出并列的候选项及其区分字段(、
webUrl或id),询问用户具体指的是哪一个。切勿随意选择,也不要对所有匹配项执行写入操作。尤其是网站名称,在不同部门间可能重复(例如两个“营销”网站)。lastModifiedDateTime
不支持的操作——直接说明并停止;不要用其他工具伪造功能。此工具集明确不支持以下操作:
- 跨库或跨站点移动文件(无原生移动功能)。仅支持同一库内移动。跨库/跨站点迁移的唯一方式是
moveItem→ (copyItem) →getCopyStatus,但这种方式存在数据损失:副本会获得新的ID和URL,其共享链接和权限不会迁移,且中途失败的复制可能导致文件丢失。当用户要求将文件移动到其他位置时,你可以执行此迁移操作,但绝不能将其表述为普通的“移动”:首先警告用户这是“复制后删除”的操作,告知用户文件的URL/ID会变更,共享链接和权限不会迁移,通过deleteItem确认复制成功后再删除原文件,并报告新位置。切勿静默执行复制删除操作并告知用户移动已完成。getCopyStatus - 编辑现有页面的正文,或添加非文本Web部件(图片、嵌入内容、快速链接、多列布局)。仅能在新页面上创建单个文本Web部件;编辑现有页面的内容和富Web部件不在本工具的范围内。切勿通过删除页面并重新创建来模拟编辑——这会改变页面的ID/URL,并丢失其版本历史、评论和权限。告知用户不支持原地正文编辑并停止操作。
createPage - 枚举租户中的所有网站。没有“列出所有网站”的功能——委托令牌无法实现此操作。请使用(关键词搜索)或
findSites(已知路径)。getSite - 管理内容类型、网站列、术语库元数据或触发器(新文件/新项通知)。这些功能未在此工具中暴露。
- 写入列表项的人员/组或多值查找列。这些列类型在此工具中为只读。
如果用户要求执行上述任何操作,请告知用户该操作不支持并停止——不要使用无关工具来近似实现。
<!-- END:disambiguation-and-refusals -->Auth
认证
Every shape passes auth as one connection selector, not the secret — a string. Every connector accepts (Zapier-managed auth — routes through Zapier's auth, retries, and governance layer); some also accept one or more direct-token resolvers (naming and count vary per connector) — check this connector's own resolvers rather than assuming. The prefix is optional; a bare value goes to the first resolver that claims it — a UUID-shaped bare value always claims . Each script declares the connections it needs and the resolvers each accepts. The exact syntax for passing a connection (and how to see this connector's resolver list) differs by shape — see the reference you loaded above.
[<resolver>:]<value>zapier:<connection-id><resolver>:zapier:Checking what's already configured first? Don't dump environment values to do it — or prints the value along with the name, leaking a live credential into the transcript if one is set. Check names only () or test a known name directly ().
<!-- BEGIN:skill-auth-notes? operational behavior that differs by WHICH resolver is used — a safety gate only one path enforces, scopes/permissions that differ between resolvers, a billing/plan difference tied to the auth path, or a feature only available (or unavailable) on one resolver. Not for describing how to obtain or pass a credential — that's references/use-without-zapier.md's job. Leave this region empty (unfilled) if every resolver behaves identically. -->
<!-- END:skill-auth-notes -->
envenv | grep <name>env | cut -d= -f1 | grep -i <name>[ -n "$VAR_NAME" ]No connection yet? Pick one — and follow the reference's own flow to obtain it; never just ask the user for a connection id or token as if they already have one memorized:
| Load | |
|---|---|
| Pass the credential directly | |
| Route it through a Zapier connection | |
每个组件都通过一个连接选择器传递认证信息,而非密钥——格式为的字符串。每个连接器都接受(Zapier托管的认证——通过Zapier的认证、重试和治理层路由);部分连接器还接受一种或多种直接令牌解析器(名称和数量因连接器而异)——请查看此连接器自身的解析器列表,不要假设通用。前缀是可选的;未带前缀的值会被第一个声明支持它的解析器处理——UUID格式的未带前缀值始终由解析。每个脚本都会声明其所需的连接以及支持的解析器。传递连接的确切语法(以及如何查看此连接器的解析器列表)因组件而异——请参阅你上面加载的参考文档。
[<resolver>:]<value>zapier:<connection-id><resolver>:zapier:想要先检查已配置的内容?不要通过打印环境变量来检查——或会同时打印名称和值,如果设置了有效凭证,会将其泄露到记录中。请仅检查名称()或直接测试已知名称()。
envenv | grep <name>env | cut -d= -f1 | grep -i <name>[ -n "$VAR_NAME" ]还没有连接?选择一种方式——并按照参考文档的流程获取连接;切勿直接向用户索要连接ID或令牌,仿佛他们已经记住了这些信息:
| 参考文档 | |
|---|---|
| 直接传递凭证 | |
| 通过Zapier连接路由 | |
Output format
输出格式
Every script returns a envelope:
{ data, meta }- — the script's result (the shape its
datadeclares; see the reference you loaded above for how to inspect a script's exact schema in your shape).outputSchema - — what validating
meta.outputDataValidationdid:data- — validated, nothing removed.
{ skipped: false, droppedPaths: null } - — validated, but those paths were stripped from
{ skipped: false, droppedPaths: [...], instruction }: fields the script returned from the API that thedatadoesn't declare. If you need them, re-run with output validation skipped.outputSchema - — validation was bypassed;
{ skipped: true }is the raw, unchecked script output.data
Reading dropped fields / . To receive the raw, unvalidated result, opt out of output validation (the exact syntax differs by shape — see the reference you loaded above). Input validation is never skipped.
skipOutputDataValidationTrimming the result / . To shrink a large result down to the fields you need, pass a jq expression that post-processes (again, exact syntax per shape). The jq runs against only, NOT the envelope, so write it rooted at (run the script's — or your shape's equivalent — to see its output schema). The transformed value replaces , is preserved, and the result is NOT re-validated against the output schema.
<!-- BEGIN:skill-references-table -->filterOutputDatadatadata{ data, meta }data--helpdatameta每个脚本都会返回一个结构:
{ data, meta }- ——脚本的结果(其
data声明的结构;请参阅你加载的参考文档,了解如何在你的组件中检查脚本的确切模式)。outputSchema - ——对
meta.outputDataValidation执行的验证操作:data- ——已验证,未移除任何内容。
{ skipped: false, droppedPaths: null } - ——已验证,但这些路径已从
{ skipped: false, droppedPaths: [...], instruction }中移除:脚本从API返回的字段未在data中声明。如果你需要这些字段,请在跳过输出验证的情况下重新运行。outputSchema - ——已绕过验证;
{ skipped: true }是原始的、未检查的脚本输出。data
读取被移除的字段 / 。若要接收原始的未验证结果,请选择退出输出验证(确切语法因组件而异——请参阅你加载的参考文档)。输入验证永远不会被跳过。
skipOutputDataValidation精简结果 / 。若要将大型结果精简为你需要的字段,请传递一个jq表达式对进行后处理(同样,确切语法因组件而异)。jq仅针对运行,而非结构,因此请以为根编写表达式(运行脚本的——或你的组件的等效命令——查看其输出模式)。转换后的值会替换,会被保留,且结果不会重新根据输出模式进行验证。
<!-- BEGIN:skill-references-table -->filterOutputDatadatadata{ data, meta }data--helpdatametaReferences
参考文档
Load the matching reference file before working in that area:
| Reference | Covers | Load it when |
|---|---|---|
| microsoft-sharepoint-api-gotchas.md | Graph permission scopes, error envelope (403/404/429), pagination, site/drive addressing, short-lived download URLs, async copy, resumable uploads, same-drive move, delete semantics, sharing links/invites/permissions, list-item column values (LookupId, 12-lookup limit, multi-value), and site-page draft/publish/type-cast rules. | A call errors unexpectedly (403/404/429, name conflict), you're resolving a site or drive id, working with list-item column values, or creating/publishing site pages. |
在对应场景下工作前,请加载匹配的参考文档:
| 参考文档 | 涵盖内容 | 加载时机 |
|---|---|---|
| microsoft-sharepoint-api-gotchas.md | Graph权限范围、错误结构(403/404/429)、分页、网站/驱动器寻址、短期下载URL、异步复制、可恢复上传、同驱动器移动、删除语义、共享链接/邀请/权限、列表项列值(LookupId、12次查找限制、多值)以及网站页面草稿/发布/类型转换规则。 | 当调用意外出错(403/404/429、名称冲突)、你正在解析网站或驱动器ID、处理列表项列值,或创建/发布网站页面时。 |