MCP tool
儲存引導式報表範本版本
sosoapi_save_report_template以 editor 或以上角色儲存私人 PPTX、DOCX 或 XLSX 範本版本,傳 template 來源 bytes、sourceSha256、欄位配對、expected_version 同 mutation_id。所有必填欄位要先配對,版本須為原版本加一;新範本用 expected_version=null。重試保留同一身份及內容;儲存唔會發布、產生報表或更新平台數據。
閱讀 MarkdownProfiles 及連接方式
Profiles: full · Transports: stdio, http
Profile 只影響工具可見性,不會授予權限。HTTP 不提供本機檔案上傳。SOSOAPI_OUTPUT_SCHEMAS=1 會宣告輸出 schema;兩種模式均會回傳 structured results。
權限及改動
MCP annotations 只提供工具發現提示,並非存取控制保證;實際呼叫仍須通過登入、角色、資源及能力檢查。
{
"readOnlyHint": false,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": false
}- /analytics-api/reporting/templates/save: agent:operate · synchronous_http_response
輸入欄位
必填表示在所屬物件及所選分支內必須提供;子欄位必填不代表可選的父物件亦變成必填。以下欄位名稱及規則直接來自 contract。
| 欄位/分支 | 類型/必填 | 限制 |
|---|---|---|
$ | object父物件內必填 |
|
workspace_id | string父物件內必填 |
|
template | object父物件內必填 |
|
template.id | string父物件內必填 |
|
template.version | integer父物件內必填 |
|
template.name | string父物件內必填 |
|
template.format | string父物件內必填 |
|
template.sourceBase64 | string父物件內必填 |
|
template.sourceSha256 | string父物件內必填 |
|
template.mappings | object父物件內必填 |
|
template.mappings.* | object可選/陣列項目 | — |
template.mappings.*anyOf 1 | object可選/陣列項目 |
|
template.mappings.*.kindanyOf 1 | string父物件內必填 |
|
template.mappings.*.valueanyOf 1 | string父物件內必填 |
|
template.mappings.*anyOf 2 | object可選/陣列項目 |
|
template.mappings.*.kindanyOf 2 | string父物件內必填 |
|
template.mappings.*.fieldanyOf 2 | string父物件內必填 |
|
template.mappings.*anyOf 3 | object可選/陣列項目 |
|
template.mappings.*.kindanyOf 3 | string父物件內必填 |
|
template.mappings.*.platformanyOf 3 | string父物件內必填 |
|
template.mappings.*.keyanyOf 3 | string父物件內必填 |
|
template.mappings.*.unitanyOf 3 | string父物件內必填 |
|
template.mappings.*.grainanyOf 3 | string父物件內必填 |
|
template.mappings.*.measurementKindanyOf 3 | string父物件內必填 |
|
template.mappings.*.accountIdanyOf 3 | string可選/陣列項目 |
|
template.mappings.*.providerResourceIdanyOf 3 | string | null可選/陣列項目 | — |
template.mappings.*.providerResourceIdanyOf 3 / anyOf 1 | string可選/陣列項目 |
|
template.mappings.*.providerResourceIdanyOf 3 / anyOf 2 | null可選/陣列項目 | — |
template.mappings.*.sourcePathanyOf 3 | string可選/陣列項目 |
|
template.mappings.*.requestIdanyOf 3 | string | null可選/陣列項目 | — |
template.mappings.*.requestIdanyOf 3 / anyOf 1 | string可選/陣列項目 |
|
template.mappings.*.requestIdanyOf 3 / anyOf 2 | null可選/陣列項目 | — |
template.mappings.*anyOf 4 | object可選/陣列項目 |
|
template.mappings.*.kindanyOf 4 | string父物件內必填 |
|
template.mappings.*.idanyOf 4 | string父物件內必填 |
|
template.mappings.*.versionanyOf 4 | integer父物件內必填 |
|
template.mappings.*anyOf 5 | object可選/陣列項目 |
|
template.mappings.*.kindanyOf 5 | string父物件內必填 |
|
template.mappings.*.sourceanyOf 5 | string父物件內必填 |
|
template.mappings.*.limitanyOf 5 | integer父物件內必填 |
|
template.mappings.*anyOf 6 | object可選/陣列項目 |
|
template.mappings.*.kindanyOf 6 | string父物件內必填 |
|
template.mappings.*.sourceanyOf 6 | string父物件內必填 |
|
expected_version | integer | null父物件內必填 | — |
expected_versionanyOf 1 | integer父物件內必填 |
|
expected_versionanyOf 2 | null父物件內必填 | — |
mutation_id | string父物件內必填 |
|
完整 JSON Schema
{
"type": "object",
"properties": {
"workspace_id": {
"type": "string",
"format": "uuid"
},
"template": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"format": {
"type": "string",
"enum": [
"pptx",
"docx",
"xlsx"
]
},
"sourceBase64": {
"type": "string",
"maxLength": 12582912,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
},
"sourceSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"mappings": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"text"
]
},
"value": {
"type": "string",
"maxLength": 2000
}
},
"required": [
"kind",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"selection"
]
},
"field": {
"type": "string",
"enum": [
"accounts",
"period",
"timezone",
"platforms",
"dataset",
"reviewed",
"coverage"
]
}
},
"required": [
"kind",
"field"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"metric"
]
},
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"key": {
"type": "string",
"minLength": 1,
"maxLength": 150
},
"unit": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"grain": {
"type": "string",
"enum": [
"post",
"account"
]
},
"measurementKind": {
"type": "string",
"enum": [
"lifetime",
"snapshot",
"period",
"unknown"
]
},
"accountId": {
"type": "string",
"format": "uuid"
},
"providerResourceId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
]
},
"sourcePath": {
"type": "string",
"maxLength": 2000
},
"requestId": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"platform",
"key",
"unit",
"grain",
"measurementKind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"formula"
]
},
"id": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
}
},
"required": [
"kind",
"id",
"version"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"table"
]
},
"source": {
"type": "string",
"enum": [
"measurements",
"formulas"
]
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": [
"kind",
"source",
"limit"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"chart"
]
},
"source": {
"type": "string",
"enum": [
"publication_by_platform"
]
}
},
"required": [
"kind",
"source"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"id",
"version",
"name",
"format",
"sourceBase64",
"sourceSha256",
"mappings"
],
"additionalProperties": false
},
"expected_version": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"mutation_id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"workspace_id",
"template",
"expected_version",
"mutation_id"
],
"additionalProperties": false
}結構化輸出
此 schema 描述成功工具結果的 structuredContent。MCP envelope 亦包括 content,失敗時可能設定 isError;請勿將文字收據或已接受的請求視為平台終態。權限及重試規則請參閱對應的 API 操作。
必填表示在所屬物件及所選分支內必須提供;子欄位必填不代表可選的父物件亦變成必填。以下欄位名稱及規則直接來自 contract。
| 欄位/分支 | 類型/必填 | 限制 |
|---|---|---|
$ | object父物件內必填 |
|
contractVersion | string父物件內必填 |
|
workspaceId | string父物件內必填 |
|
id | string父物件內必填 |
|
version | integer父物件內必填 |
|
name | string父物件內必填 |
|
format | string父物件內必填 |
|
sourceBase64 | string父物件內必填 |
|
sourceSha256 | string父物件內必填 |
|
mappings | object父物件內必填 |
|
mappings.* | object可選/陣列項目 | — |
mappings.*oneOf 1 | object可選/陣列項目 |
|
mappings.*.kindoneOf 1 | string父物件內必填 |
|
mappings.*.valueoneOf 1 | string父物件內必填 |
|
mappings.*oneOf 2 | object可選/陣列項目 |
|
mappings.*.kindoneOf 2 | string父物件內必填 |
|
mappings.*.fieldoneOf 2 | string父物件內必填 |
|
mappings.*oneOf 3 | object可選/陣列項目 |
|
mappings.*.kindoneOf 3 | string父物件內必填 |
|
mappings.*.platformoneOf 3 | string父物件內必填 |
|
mappings.*.keyoneOf 3 | string父物件內必填 |
|
mappings.*.unitoneOf 3 | string父物件內必填 |
|
mappings.*.grainoneOf 3 | string父物件內必填 |
|
mappings.*.measurementKindoneOf 3 | string父物件內必填 |
|
mappings.*.accountIdoneOf 3 | string可選/陣列項目 |
|
mappings.*.providerResourceIdoneOf 3 | string | null可選/陣列項目 | — |
mappings.*.providerResourceIdoneOf 3 / anyOf 1 | string可選/陣列項目 |
|
mappings.*.providerResourceIdoneOf 3 / anyOf 2 | null可選/陣列項目 | — |
mappings.*.sourcePathoneOf 3 | string可選/陣列項目 |
|
mappings.*.requestIdoneOf 3 | string | null可選/陣列項目 | — |
mappings.*.requestIdoneOf 3 / anyOf 1 | string可選/陣列項目 |
|
mappings.*.requestIdoneOf 3 / anyOf 2 | null可選/陣列項目 | — |
mappings.*oneOf 4 | object可選/陣列項目 |
|
mappings.*.kindoneOf 4 | string父物件內必填 |
|
mappings.*.idoneOf 4 | string父物件內必填 |
|
mappings.*.versiononeOf 4 | integer父物件內必填 |
|
mappings.*oneOf 5 | object可選/陣列項目 |
|
mappings.*.kindoneOf 5 | string父物件內必填 |
|
mappings.*.sourceoneOf 5 | string父物件內必填 |
|
mappings.*.limitoneOf 5 | integer父物件內必填 |
|
mappings.*oneOf 6 | object可選/陣列項目 |
|
mappings.*.kindoneOf 6 | string父物件內必填 |
|
mappings.*.sourceoneOf 6 | string父物件內必填 |
|
createdAt | string父物件內必填 |
|
完整 JSON Schema
{
"type": "object",
"properties": {
"contractVersion": {
"type": "string",
"const": "analytics-template/v1"
},
"workspaceId": {
"type": "string",
"format": "uuid"
},
"id": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"format": {
"type": "string",
"enum": [
"pptx",
"docx",
"xlsx"
]
},
"sourceBase64": {
"type": "string",
"maxLength": 12582912,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
},
"sourceSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"mappings": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,63}$"
},
"additionalProperties": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "text"
},
"value": {
"type": "string",
"maxLength": 2000
}
},
"required": [
"kind",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "selection"
},
"field": {
"type": "string",
"enum": [
"accounts",
"period",
"timezone",
"platforms",
"dataset",
"reviewed",
"coverage"
]
}
},
"required": [
"kind",
"field"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "metric"
},
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"key": {
"type": "string",
"minLength": 1,
"maxLength": 150
},
"unit": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"grain": {
"type": "string",
"enum": [
"post",
"account"
]
},
"measurementKind": {
"type": "string",
"enum": [
"lifetime",
"snapshot",
"period",
"unknown"
]
},
"accountId": {
"type": "string",
"format": "uuid"
},
"providerResourceId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
]
},
"sourcePath": {
"type": "string",
"maxLength": 2000
},
"requestId": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"platform",
"key",
"unit",
"grain",
"measurementKind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "formula"
},
"id": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
}
},
"required": [
"kind",
"id",
"version"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "table"
},
"source": {
"type": "string",
"enum": [
"measurements",
"formulas"
]
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": [
"kind",
"source",
"limit"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "chart"
},
"source": {
"type": "string",
"const": "publication_by_platform"
}
},
"required": [
"kind",
"source"
],
"additionalProperties": false
}
]
}
},
"createdAt": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
}
},
"required": [
"contractVersion",
"workspaceId",
"id",
"version",
"name",
"format",
"sourceBase64",
"sourceSha256",
"mappings",
"createdAt"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false
}工具呼叫範例
以下虛構值已按 contract 驗證,並非真實帳戶 ID、憑證或發佈紀錄。請以已授權範圍回傳的 ID、已準備完成的素材及已審核排程取代,並在寫入前核對平台資格。此頁不會呼叫 API。
{
"name": "sosoapi_save_report_template",
"arguments": {
"workspace_id": "11111111-1111-4111-8111-111111111111",
"template": {
"id": "11111111-1111-4111-8111-111111111111",
"version": 1,
"name": "example",
"format": "pptx",
"sourceBase64": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"sourceSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"mappings": {}
},
"expected_version": null,
"mutation_id": "11111111-1111-4111-8111-111111111111"
}
}structuredContent
{
"contractVersion": "analytics-template/v1",
"workspaceId": "11111111-1111-4111-8111-111111111111",
"id": "11111111-1111-4111-8111-111111111111",
"version": 1,
"name": "example",
"format": "pptx",
"sourceBase64": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"sourceSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"mappings": {},
"createdAt": "2099-01-15T09:00:00Z"
}