MCP टूल
API key बनाएँ
sosoapi_create_api_keyचुनी गई क्षमताओं (agent:operate, agent:publish, agent:engage), वैकल्पिक workspace_ids सीमा और अधिकतम 365 दिन की अवधि वाली निजी एक्सेस key बनाएँ; सीक्रेट केवल एक बार लौटाया जाता है और दोबारा नहीं पढ़ा जा सकता। एजेंट केवल अपने प्राधिकरण में उपलब्ध अधिकार, अधिकतम 30 दिनों के लिए दे सकता है, और प्राधिकरण समाप्त होने पर key काम करना बंद कर देती है। Manage API keys का अधिकार आवश्यक है; PAT इसका उपयोग नहीं कर सकता।
Markdown में पढ़ेंप्रोफ़ाइल और ट्रांसपोर्ट
प्रोफ़ाइल: full · ट्रांसपोर्ट: stdio, http
क्लाइंट में दिखने वाले टूल के लिए core या full चुनें; इससे अनुमतियाँ नहीं बदलतीं। लोकल फ़ाइल अपलोड के लिए stdio चाहिए और HTTP पर उपलब्ध नहीं। खोज में आउटपुट स्कीमा के लिए SOSOAPI_OUTPUT_SCHEMAS=1 सेट करें। इस सेटिंग के साथ या बिना टूल संरचित परिणाम लौटाते हैं।
अनुमतियाँ और अन्य प्रभाव
एनोटेशन क्लाइंट को टूल का वर्णन करने में मदद करते हैं। हर कॉल फिर भी यूज़र का प्रमाणीकरण, भूमिका, संसाधन एक्सेस और क्षमता अधिकार जाँचती है।
{
"readOnlyHint": false,
"destructiveHint": false,
"idempotentHint": false,
"openWorldHint": false
}- /identity-api/api-keys/create: agent:manage_api_keys · synchronous_http_response
इनपुट फ़ील्ड
Required का अर्थ पैरेंट ऑब्जेक्ट और चुनी शाखा के भीतर अनिवार्य है। अनिवार्य चाइल्ड से वैकल्पिक पैरेंट अनिवार्य नहीं होता। नीचे के नियम और फ़ील्ड नाम कॉन्ट्रैक्ट से लिए गए हैं।
| फ़ील्ड / शाखा | प्रकार / अनिवार्य | शर्तें |
|---|---|---|
$ | objectपैरेंट में अनिवार्य |
|
name | stringपैरेंट में अनिवार्य |
|
lifetime_days | integerवैकल्पिक / आइटम | key समाप्त होने तक दिन (1-365, डिफ़ॉल्ट 365)। प्रत्यायोजित एजेंट की बनाई key कभी 30 दिनों से अधिक नहीं चलती।
|
capabilities | arrayवैकल्पिक / आइटम | key क्या कर सकती है। साइन इन किए यूज़र के लिए डिफ़ॉल्ट operate, publish और engage हैं। प्रत्यायोजित एजेंट केवल अपने प्राधिकरण के अधिकार दे सकता है (key प्रबंधन कभी नहीं)।
|
capabilities[] | stringवैकल्पिक / आइटम |
|
workspace_ids | arrayवैकल्पिक / आइटम | key को इन Workspaces तक सीमित करें। यूज़र के सभी उपलब्ध Workspace के लिए इसे छोड़ें। सीमित key को सक्रिय Workspace इस्तेमाल करने वाले रूट पर अपना Workspace (workspace_id) देना होगा और वह संगठन-व्यापी रीड कॉल नहीं कर सकती।
|
workspace_ids[] | stringवैकल्पिक / आइटम |
|
scopes | arrayवैकल्पिक / आइटम | capabilities का पुराना उपनाम। इसे ठीक वैसे ही लागू किया जाता है; खाली सूची अनदेखी होती है।
|
scopes[] | stringवैकल्पिक / आइटम |
|
idempotency_key | stringवैकल्पिक / आइटम | वैकल्पिक। सुरक्षित पुनः प्रयास के लिए समान key इस्तेमाल करें। सीक्रेट एक बार दिखता है: पुनः प्रयास में key पहले से बनी मिले, तो उसे फिर दिखाने के बजाय 409 IDEMPOTENT_REPLAY मिलता है (details.existing_key उसकी पहचान देता है)। वह key निरस्त करें और नई idempotency_key से नई key बनाएँ।
|
संपूर्ण JSON Schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"lifetime_days": {
"description": "Days until the key expires (1-365, default 365). A key created by a delegated agent never lives longer than 30 days.",
"type": "integer",
"minimum": 1,
"maximum": 365
},
"capabilities": {
"description": "What the key may do. Defaults to operate, publish and engage for a signed-in user. A delegated agent can only grant what its own authorization holds (never key management).",
"minItems": 1,
"maxItems": 3,
"type": "array",
"items": {
"type": "string",
"enum": [
"agent:operate",
"agent:publish",
"agent:engage"
]
}
},
"workspace_ids": {
"description": "Limit the key to these Workspaces. Omit it for every Workspace the user can access. A limited key must name its Workspace (workspace_id) on routes that would otherwise use the active Workspace, and cannot call organization-wide reads.",
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"scopes": {
"description": "Deprecated alias of capabilities. It is honoured exactly; an empty list is ignored.",
"maxItems": 3,
"type": "array",
"items": {
"type": "string",
"enum": [
"agent:operate",
"agent:publish",
"agent:engage"
]
}
},
"idempotency_key": {
"description": "Optional. Reuse the same key to retry safely. The secret is shown once: a retry that finds the key already created answers 409 IDEMPOTENT_REPLAY (details.existing_key names it) instead of showing it again. Revoke that key and create a new one with a new idempotency_key.",
"type": "string",
"minLength": 8,
"maxLength": 160,
"pattern": "^[!-~]+$"
}
},
"required": [
"name"
],
"additionalProperties": false
}संरचित आउटपुट
यह स्कीमा सफल टूल परिणाम के structuredContent का वर्णन करता है। MCP रिस्पॉन्स में content भी होता है और कॉल विफल होने पर isError सेट हो सकता है। प्रकाशन के लिए स्वीकृत अनुरोध या टेक्स्ट रिस्पॉन्स को पुष्टि मानने के बजाय पोस्ट का अंतिम परिणाम पढ़ें। लिंक किया गया API ऑपरेशन अनुमतियाँ और पुनः प्रयास के नियम समझाता है।
Required का अर्थ पैरेंट ऑब्जेक्ट और चुनी शाखा के भीतर अनिवार्य है। अनिवार्य चाइल्ड से वैकल्पिक पैरेंट अनिवार्य नहीं होता। नीचे के नियम और फ़ील्ड नाम कॉन्ट्रैक्ट से लिए गए हैं।
| फ़ील्ड / शाखा | प्रकार / अनिवार्य | शर्तें |
|---|---|---|
$ | objectपैरेंट में अनिवार्य |
|
apiKey | objectपैरेंट में अनिवार्य |
|
apiKey.id | stringपैरेंट में अनिवार्य |
|
apiKey.name | stringपैरेंट में अनिवार्य | — |
apiKey.last_4 | stringपैरेंट में अनिवार्य | — |
apiKey.scopes | arrayपैरेंट में अनिवार्य | — |
apiKey.scopes[] | stringवैकल्पिक / आइटम | — |
apiKey.created_at | stringपैरेंट में अनिवार्य |
|
apiKey.expires_at | string | nullपैरेंट में अनिवार्य | — |
apiKey.expires_atanyOf 1 | stringपैरेंट में अनिवार्य |
|
apiKey.expires_atanyOf 2 | nullपैरेंट में अनिवार्य | — |
apiKey.last_used_at | string | nullपैरेंट में अनिवार्य | — |
apiKey.last_used_atanyOf 1 | stringपैरेंट में अनिवार्य |
|
apiKey.last_used_atanyOf 2 | nullपैरेंट में अनिवार्य | — |
apiKey.revoked_at | string | nullपैरेंट में अनिवार्य | — |
apiKey.revoked_atanyOf 1 | stringपैरेंट में अनिवार्य |
|
apiKey.revoked_atanyOf 2 | nullपैरेंट में अनिवार्य | — |
apiKey.status | stringपैरेंट में अनिवार्य |
|
apiKey.replaces | object | nullपैरेंट में अनिवार्य | — |
apiKey.replacesanyOf 1 | objectपैरेंट में अनिवार्य |
|
apiKey.replaces.idanyOf 1 | stringपैरेंट में अनिवार्य |
|
apiKey.replaces.nameanyOf 1 | stringपैरेंट में अनिवार्य | — |
apiKey.replaces.last_4anyOf 1 | stringपैरेंट में अनिवार्य | — |
apiKey.replaces.statusanyOf 1 | stringपैरेंट में अनिवार्य |
|
apiKey.replacesanyOf 2 | nullपैरेंट में अनिवार्य | — |
apiKey.replaced_by | arrayपैरेंट में अनिवार्य | — |
apiKey.replaced_by[] | objectवैकल्पिक / आइटम |
|
apiKey.replaced_by[].id | stringपैरेंट में अनिवार्य |
|
apiKey.replaced_by[].name | stringपैरेंट में अनिवार्य | — |
apiKey.replaced_by[].last_4 | stringपैरेंट में अनिवार्य | — |
apiKey.replaced_by[].status | stringपैरेंट में अनिवार्य |
|
apiKey.capabilities | arrayवैकल्पिक / आइटम | — |
apiKey.capabilities[] | stringवैकल्पिक / आइटम |
|
apiKey.workspace_ids | array | nullवैकल्पिक / आइटम | — |
apiKey.workspace_idsanyOf 1 | arrayवैकल्पिक / आइटम | — |
apiKey.workspace_ids[]anyOf 1 | stringवैकल्पिक / आइटम |
|
apiKey.workspace_idsanyOf 2 | nullवैकल्पिक / आइटम | — |
apiKey.created_by_delegated_grant_id | string | nullवैकल्पिक / आइटम | — |
apiKey.created_by_delegated_grant_idanyOf 1 | stringवैकल्पिक / आइटम |
|
apiKey.created_by_delegated_grant_idanyOf 2 | nullवैकल्पिक / आइटम | — |
secret | stringपैरेंट में अनिवार्य |
|
संपूर्ण JSON Schema
{
"type": "object",
"properties": {
"apiKey": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"last_4": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"created_at": {
"type": "string",
"format": "date-time",
"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)))$"
},
"expires_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"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)))$"
},
{
"type": "null"
}
]
},
"last_used_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"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)))$"
},
{
"type": "null"
}
]
},
"revoked_at": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"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)))$"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"active",
"expired",
"revoked"
]
},
"replaces": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"last_4": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"active",
"expired",
"revoked"
]
}
},
"required": [
"id",
"name",
"last_4",
"status"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"replaced_by": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"last_4": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"active",
"expired",
"revoked"
]
}
},
"required": [
"id",
"name",
"last_4",
"status"
],
"additionalProperties": false
}
},
"capabilities": {
"type": "array",
"items": {
"type": "string",
"enum": [
"agent:operate",
"agent:publish",
"agent:engage"
]
}
},
"workspace_ids": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
{
"type": "null"
}
]
},
"created_by_delegated_grant_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"name",
"last_4",
"scopes",
"created_at",
"expires_at",
"last_used_at",
"revoked_at",
"status",
"replaces",
"replaced_by"
],
"additionalProperties": false
},
"secret": {
"type": "string",
"minLength": 1
}
},
"required": [
"apiKey",
"secret"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false
}टूल कॉल का उदाहरण
उदाहरणों में स्कीमा से जाँचे काल्पनिक मान हैं। IDs को अधिकृत IDs, मीडिया को तैयार एसेट और तारीखों को पुष्ट प्रकाशन समय से बदलें। राइट सबमिट करने से पहले खाते की पात्रता जाँचें। यह पेज API अनुरोध नहीं भेजता।
{
"name": "sosoapi_create_api_key",
"arguments": {
"name": "example"
}
}structuredContent
{
"apiKey": {
"id": "11111111-1111-4111-8111-111111111111",
"name": "example",
"last_4": "example",
"scopes": [],
"created_at": "2099-01-15T09:00:00Z",
"expires_at": null,
"last_used_at": null,
"revoked_at": null,
"status": "active",
"replaces": null,
"replaced_by": []
},
"secret": "example"
}