{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Diet Records Search MCP — Parliament Speeches for AI",
    "description": "Search Japan's National Diet (parliament) proceedings from your AI agent: speeches, committee meetings and excerpts for summaries, via the National Diet Library's official API, as MCP tools. Also runs as a normal batch Actor. 国立国会図書館の会議録検索を MCP ツール化。通常 run にも対応。",
    "version": "0.3",
    "x-build-id": "fwhGR9sWamfSvpbGL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aflame_brigantine~kokkai-search-mcp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aflame_brigantine-kokkai-search-mcp",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/aflame_brigantine~kokkai-search-mcp/runs": {
      "post": {
        "operationId": "runs-sync-aflame_brigantine-kokkai-search-mcp",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/aflame_brigantine~kokkai-search-mcp/run-sync": {
      "post": {
        "operationId": "run-sync-aflame_brigantine-kokkai-search-mcp",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What this run returns (run mode)",
            "enum": [
              "search_speeches",
              "search_meetings",
              "get_speech",
              "summarize_topic",
              "mcp_server",
              ""
            ],
            "type": "string",
            "description": "Normal run (default): search_speeches returns real speeches into the dataset in seconds. To use the Actor as an MCP server, connect to its Standby URL instead (see README); mcp_server / empty keep that mode for older saved tasks. 通常 run では search_speeches が既定で、すぐにデータセットへ発言が出ます。MCP クライアントから使うときは README の Standby URL に接続してください（mcp_server / 空欄は従来の保存済みタスク用）。",
            "default": "search_speeches"
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "Words in the speech (space = AND). 発言内容・会議名の検索語（半角スペース区切りは AND）。検索条件が 1 つも無い通常 run は見本の検索語「生成AI」で実行します。",
            "default": ""
          },
          "speaker": {
            "title": "Speaker",
            "type": "string",
            "description": "発言者名（部分一致。半角スペース区切りは OR）。search_speeches / summarize_topic のみ。",
            "default": ""
          },
          "house": {
            "title": "House",
            "enum": [
              "",
              "衆議院",
              "参議院",
              "両院",
              "両院協議会"
            ],
            "type": "string",
            "description": "院名で絞り込みます。",
            "default": ""
          },
          "from": {
            "title": "From",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "開催日の下限（YYYY-MM-DD）。",
            "default": ""
          },
          "until": {
            "title": "Until",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "開催日の上限（YYYY-MM-DD）。",
            "default": ""
          },
          "meetingName": {
            "title": "Meeting name",
            "type": "string",
            "description": "会議名（委員会名など）の部分一致。半角スペース区切りで OR（例: 予算 決算）。公式 API の nameOfMeeting。",
            "default": ""
          },
          "speakerGroup": {
            "title": "Speaker's party / group (会派)",
            "type": "string",
            "description": "発言者の所属会派（正式名称の部分一致。例: 自由民主党）。search_speeches / summarize_topic のみ。公式 API の speakerGroup。",
            "default": ""
          },
          "speakerPosition": {
            "title": "Speaker's position (肩書き)",
            "type": "string",
            "description": "発言者の肩書きの部分一致（例: 内閣総理大臣）。search_speeches / summarize_topic のみ。公式 API の speakerPosition。",
            "default": ""
          },
          "speakerRole": {
            "title": "Speaker's role (役割)",
            "enum": [
              "",
              "証人",
              "参考人",
              "公述人"
            ],
            "type": "string",
            "description": "証人 / 参考人 / 公述人 のいずれか。search_speeches / summarize_topic のみ。",
            "default": ""
          },
          "sessionFrom": {
            "title": "Diet session from (国会回次)",
            "minimum": 1,
            "maximum": 999,
            "type": "integer",
            "description": "国会回次（開始）。sessionTo 無しならこの回次だけ。例: 221。"
          },
          "sessionTo": {
            "title": "Diet session to (国会回次)",
            "minimum": 1,
            "maximum": 999,
            "type": "integer",
            "description": "国会回次（終了）。sessionFrom と組み合わせて範囲指定。"
          },
          "limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "取得件数上限。この件数分だけ speech-record イベントが課金されます。監視モード（onlyNewSpeeches）では「1 回に返す新着の上限」になります（watch mode: max new speeches returned per run）。API上限は1回100件です。",
            "default": 10
          },
          "startRecord": {
            "title": "Start record (paging / ページ送り)",
            "minimum": 1,
            "type": "integer",
            "description": "取得開始位置（1 始まり）。前回の run の OUTPUT にある nextStartRecord を入れると次の limit 件が取れます。",
            "default": 1
          },
          "onlyNewSpeeches": {
            "title": "Watch mode: only new speeches (not returned before / 新着だけ)",
            "type": "boolean",
            "description": "Turn on to get only speeches you have not received in an earlier run with the same search (schedule it daily to watch a topic). The first run returns the newest speeches (up to Limit) as usual. Later runs look at the newest 100 speeches and return the oldest ones not returned before, up to Limit per run; the rest wait for the next run. If new speeches keep exceeding Limit, waiting ones can eventually fall out of the newest 100: raise Limit or run more often (OUTPUT.watch.mayHaveMissed tells you). You pay the start fee plus only the speeches returned, so a run with nothing new costs just the start fee. Works with search_speeches and summarize_topic. The record of what was already returned is kept in a named key-value store (see stateStoreName). 同じ検索条件の前回までの run で返していない発言だけを返します（毎日の Schedule で話題を見張る用途）。初回は通常どおり返し、2 回目以降は新しい発言だけ（課金も新しい分だけ）。search_speeches / summarize_topic のみ対象。",
            "default": false
          },
          "stateStoreName": {
            "title": "Watch state store name (advanced)",
            "type": "string",
            "description": "Only used with watch mode. Name of the key-value store that remembers already returned speeches. Leave empty: a name like kokkai-seen-<hash> is made from your search conditions, so runs with the same conditions share one record. Set a name to separate or share watches (lowercase letters, digits, hyphens, 3 to 63 characters). To start over, delete that store in Console > Storage. 監視モードのときだけ使います。空欄なら検索条件から kokkai-seen-<ハッシュ> を自動で付けます。",
            "default": ""
          },
          "speechId": {
            "title": "Speech ID",
            "type": "string",
            "description": "get_speech モードで指定する発言ID（search_speeches の結果の speechId。例: 122105261X01720260727_073）。検索済みでなくても公式 API の speechID で直接取得します。",
            "default": ""
          },
          "maxChars": {
            "title": "Max characters",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "get_speech モードでの全文の文字数上限（既定・上限とも5,000字）。",
            "default": 5000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}