# Discourse\_list\_private\_messages は per\_page を送信するため常に Discourse HTTP 500 を引き起こす

**URL:** https://meta.discourse.org/t/discourse-list-private-messages-always-causes-discourse-http-500-by-sending-per-page/412242
**Category:** Bug
**Tags:** mcp
**Created:** [2026 年 9 月 11 日午後 6:26 UTC](https://meta.discourse.org/t/discourse-list-private-messages-always-causes-discourse-http-500-by-sending-per-page/412242 "2026-09-11T18:26:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Crashley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crashley/32/280495_2.png) [@Crashley](https://meta.discourse.org/u/Crashley)
#### Post date: [2026 年 9 月 11 日午後 6:26 UTC](https://meta.discourse.org/t/discourse-list-private-messages-always-causes-discourse-http-500-by-sending-per-page/412242/1 "2026-09-11T18:26:15Z")

</div>

**再現手順**

```plaintext
GET /topics/private-messages/ashley.json?page=0&per_page=20

```

**観察された現象**

```plaintext
TypeError: String can't be coerced into Integer
lib/topic_query/private_message_lists.rb:277

```

**原因**

```plaintext
offset = options[:page].to_i * options[:per_page]

```

MCPの **`list.ts`** は常に以下を構築します：

```plaintext
new URLSearchParams({
  page: String(page),
  per_page: String(per_page),
});

```

**期待される修正**

上流のリクエストからサポートされていない **`per_page`** を省略するか、Discourseコア側で有界な整数強制変換の修正を調整してください。
