# アカウントへのメンションを分類する

正規URL： https://sosoapi.ai/ja/docs/mcp/listening-mentions-set-state

`sosoapi_listening_mentions_set_state`

expected_revision を使ってローカルのアカウントメンション分類を更新します。プロバイダーのコンテンツへの返信、非表示、削除は行いません。agent:research が必要です。

## プロファイルと通信方式

プロファイル： full

通信方式： stdio, http

coreまたはfullで表示ツールを選べますが権限は変わりません。ローカルアップロードはstdioのみでHTTPは非対応です。SOSOAPI_OUTPUT_SCHEMAS=1で検出時に出力スキーマを含めます。設定に関係なく構造化結果を返します。

## 権限と副作用

注釈はクライアントがツールを説明するためのものです。各呼び出しでは引き続き認証、ロール、リソースアクセス、機能権限を確認します。

```json
{
  "readOnlyHint": false,
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": true
}
```

`/listening-api/mentions/set-state` — agent:research; 確定済みの Workspace 内だけの分類バージョン。プロバイダー操作はありません

## 入力フィールド

```json
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid"
    },
    "social_account_id": {
      "type": "string",
      "format": "uuid"
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "mutation_id": {
      "type": "string",
      "format": "uuid"
    },
    "expected_revision": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "handled": {
      "type": "boolean"
    },
    "archived": {
      "type": "boolean"
    }
  },
  "required": [
    "workspace_id",
    "social_account_id",
    "id",
    "mutation_id",
    "expected_revision"
  ],
  "additionalProperties": false
}
```

## 構造化された出力

このスキーマは、成功時のツール結果に含まれるstructuredContentを説明します。MCPレスポンスはcontentも含み、失敗時にisErrorを設定する場合があります。公開では、受理やテキスト応答を確認済みと扱わず、投稿の最終結果を取得してください。権限・再試行ルールはリンク先のAPI操作をご覧ください。

```json
{
  "type": "object",
  "properties": {
    "mention": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid"
        },
        "social_account_id": {
          "type": "string",
          "format": "uuid"
        },
        "provider_post_id": {
          "type": "string",
          "pattern": "^\\d{2,20}$"
        },
        "source": {
          "type": "string",
          "const": "threads"
        },
        "relationship": {
          "type": "string",
          "const": "account_mention"
        },
        "revision": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "handled": {
          "type": "boolean"
        },
        "archived": {
          "type": "boolean"
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "expired",
            "unavailable"
          ]
        },
        "post": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^\\d{2,20}$"
                },
                "text": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 30000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "username": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9._]{1,30}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "permalink": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "timestamp": {
                  "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"
                    }
                  ]
                },
                "media_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "TEXT",
                        "TEXT_POST",
                        "IMAGE",
                        "VIDEO",
                        "CAROUSEL_ALBUM",
                        "AUDIO",
                        "REPOST_FACADE"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "is_reply": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "is_quote_post": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "has_replies": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "root_post_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{2,20}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "replied_to_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{2,20}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "text",
                "username",
                "permalink",
                "timestamp",
                "media_type",
                "is_reply",
                "is_quote_post",
                "has_replies"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "first_observed_at": {
          "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"
        },
        "last_checked_at": {
          "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"
        },
        "expires_at": {
          "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"
        },
        "coverage": {
          "type": "string",
          "const": "partial_native_page"
        }
      },
      "required": [
        "id",
        "workspace_id",
        "social_account_id",
        "provider_post_id",
        "source",
        "relationship",
        "revision",
        "handled",
        "archived",
        "availability",
        "post",
        "first_observed_at",
        "last_checked_at",
        "expires_at",
        "coverage"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "mention"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
```

## ツール呼び出しの例

スキーマ確認済みの架空値の例です。認可されたID、準備済みメディア、確認済みの公開日時に置き換え、書き込み前に適格性を確認してください。このページはAPIを呼びません。

```json
{
  "name": "sosoapi_listening_mentions_set_state",
  "arguments": {
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "social_account_id": "22222222-2222-4222-8222-222222222222",
    "id": "30000000-0000-4000-8000-000000000006",
    "mutation_id": "40000000-0000-4000-8000-000000000004",
    "expected_revision": 1,
    "handled": true
  }
}
```

structuredContent

```json
{
  "mention": {
    "id": "30000000-0000-4000-8000-000000000006",
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "social_account_id": "22222222-2222-4222-8222-222222222222",
    "provider_post_id": "9999999999999999",
    "source": "threads",
    "relationship": "account_mention",
    "revision": 2,
    "handled": true,
    "archived": false,
    "availability": "unavailable",
    "post": null,
    "first_observed_at": "2099-01-15T09:00:00Z",
    "last_checked_at": "2099-01-15T09:00:00Z",
    "expires_at": "2099-01-16T09:00:00Z",
    "coverage": "partial_native_page"
  }
}
```

## 基礎となるAPI操作

- [/listening-api/mentions/set-state](https://sosoapi.ai/ja/docs/api/listening-api-mentions-set-state)
