# リスニング一致結果の分類を更新する

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

`sosoapi_listening_results_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/results/set-state` — agent:research; 確定済みのリスニングリソースバージョンまたは取消フェンス。ソーシャルプラットフォームへの書き込みはありません

## 入力フィールド

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

## 構造化された出力

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

```json
{
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid"
        },
        "stream_id": {
          "type": "string",
          "format": "uuid"
        },
        "run_id": {
          "type": "string",
          "format": "uuid"
        },
        "revision": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "source": {
          "type": "string",
          "const": "hacker_news"
        },
        "source_item_id": {
          "type": "string",
          "pattern": "^[1-9][0-9]{0,15}$"
        },
        "canonical_url": {
          "type": "string",
          "pattern": "^https:\\/\\/news\\.ycombinator\\.com\\/item\\?id=[1-9][0-9]{0,15}$"
        },
        "title": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 500
            },
            {
              "type": "null"
            }
          ]
        },
        "excerpt": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 4000
            },
            {
              "type": "null"
            }
          ]
        },
        "author": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "published_at": {
          "anyOf": [
            {
              "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"
            },
            {
              "type": "null"
            }
          ]
        },
        "retrieved_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"
        },
        "source_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"
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "removed",
            "expired",
            "unavailable"
          ]
        },
        "metrics": {
          "type": "object",
          "properties": {
            "score": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "replies": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "score",
            "replies"
          ],
          "additionalProperties": false
        },
        "handled": {
          "type": "boolean"
        },
        "archived": {
          "type": "boolean"
        },
        "match_kind": {
          "type": "string",
          "const": "literal_query_match"
        },
        "coverage": {
          "type": "string",
          "const": "partial_indexed_sample"
        },
        "sentiment": {
          "type": "null"
        }
      },
      "required": [
        "id",
        "workspace_id",
        "stream_id",
        "run_id",
        "revision",
        "source",
        "source_item_id",
        "canonical_url",
        "title",
        "excerpt",
        "author",
        "published_at",
        "retrieved_at",
        "source_checked_at",
        "expires_at",
        "availability",
        "metrics",
        "handled",
        "archived",
        "match_kind",
        "coverage",
        "sentiment"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "result"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
```

## ツール呼び出しの例

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

```json
{
  "name": "sosoapi_listening_results_set_state",
  "arguments": {
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "id": "30000000-0000-4000-8000-000000000005",
    "mutation_id": "40000000-0000-4000-8000-000000000003",
    "expected_revision": 1,
    "handled": true
  }
}
```

structuredContent

```json
{
  "result": {
    "id": "30000000-0000-4000-8000-000000000005",
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "stream_id": "30000000-0000-4000-8000-000000000004",
    "run_id": "30000000-0000-4000-8000-000000000009",
    "revision": 2,
    "source": "hacker_news",
    "source_item_id": "9999999999999999",
    "canonical_url": "https://news.ycombinator.com/item?id=9999999999999999",
    "title": null,
    "excerpt": null,
    "author": null,
    "published_at": null,
    "retrieved_at": "2099-01-15T09:00:00Z",
    "source_checked_at": "2099-01-15T09:00:00Z",
    "expires_at": "2099-01-16T09:00:00Z",
    "availability": "unavailable",
    "metrics": {
      "score": null,
      "replies": null
    },
    "handled": true,
    "archived": false,
    "match_kind": "literal_query_match",
    "coverage": "partial_indexed_sample",
    "sentiment": null
  }
}
```

## 基礎となるAPI操作

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