# Activity

## Get Post Replies

`TOOL discourse_get_post_replies`

Read reply relationships for a post as recursive descendant IDs, bounded rich direct replies, or the upstream-bounded ancestor history. Preserves upstream ordering and references.

Authentication: no security requirement declared for this operation.

Parameters:

- `post_id` (argument, integer, required)
  Type: integer
  
  exclusiveMinimum: 0

- `mode` (argument, string, optional) - reply_ids returns recursive descendant IDs; direct_replies returns up to 20 rich direct replies; reply_history returns ancestors
  Type: string
  
  reply_ids returns recursive descendant IDs; direct_replies returns up to 20 rich direct replies; reply_history returns ancestors
  
  enum: ["reply_ids","direct_replies","reply_history"]

- `after_post_number` (argument, integer, optional)
  Type: integer
  
  minimum: 0

Declared MCP annotations:

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

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_get_post_replies",
    "arguments": {
        "post_id": 0,
        "mode": "reply_ids",
        "after_post_number": 0
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_get_post_replies",
  "arguments": {
    "post_id": 0,
    "mode": "reply_ids",
    "after_post_number": 0
  }
});
```

### Python

```python
result = await session.call_tool("discourse_get_post_replies", arguments={
  "post_id": 0,
  "mode": "reply_ids",
  "after_post_number": 0
})
```


## List Latest Posts

`TOOL discourse_list_latest_posts`

List the site's latest visible posts using Discourse's fixed 50-post page and post-ID cursor. Anonymous upstream responses expire after one minute; results are a feed, not an exhaustive history.

Authentication: no security requirement declared for this operation.

Parameters:

- `before_post_id` (argument, integer, optional)
  Type: integer
  
  exclusiveMinimum: 0

- `replies_only` (argument, boolean, optional)
  Type: boolean

Declared MCP annotations:

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

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_latest_posts",
    "arguments": {
        "before_post_id": 0,
        "replies_only": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_latest_posts",
  "arguments": {
    "before_post_id": 0,
    "replies_only": true
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_latest_posts", arguments={
  "before_post_id": 0,
  "replies_only": true
})
```


## Get Topic View Stats

`TOOL discourse_get_topic_view_stats`

Get up to 300 ascending daily topic view counts. Views combine anonymous and logged-in views; they are not unique viewers or an engagement judgment.

Authentication: no security requirement declared for this operation.

Parameters:

- `topic_id` (argument, integer, required)
  Type: integer
  
  exclusiveMinimum: 0

- `from` (argument, string, optional)
  Type: string
  
  pattern: "^\\d{4}-\\d{2}-\\d{2}$"

- `to` (argument, string, optional)
  Type: string
  
  pattern: "^\\d{4}-\\d{2}-\\d{2}$"

Declared MCP annotations:

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

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_get_topic_view_stats",
    "arguments": {
        "topic_id": 0,
        "from": "string",
        "to": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_get_topic_view_stats",
  "arguments": {
    "topic_id": 0,
    "from": "string",
    "to": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_get_topic_view_stats", arguments={
  "topic_id": 0,
  "from": "string",
  "to": "string"
})
```


## Get User Summary

`TOOL discourse_get_user_summary`

Get profile-visible aggregate user activity, top topics/replies/links, interaction partners, categories, badges, likes, visits, reading, and post/topic counts. Missing metrics remain null when hidden or unavailable.

Authentication: no security requirement declared for this operation.

Parameters:

- `username` (argument, string, required)
  Type: string
  
  minLength: 1

Declared MCP annotations:

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

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_get_user_summary",
    "arguments": {
        "username": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_get_user_summary",
  "arguments": {
    "username": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_get_user_summary", arguments={
  "username": "string"
})
```


## List User Actions

`TOOL discourse_list_user_actions`

List a user's visible activity using model-friendly action names. Plugin-backed action families can legitimately be empty; emptiness does not prove that a feature is unavailable.

Authentication: no security requirement declared for this operation.

Parameters:

- `username` (argument, string, required)
  Type: string
  
  minLength: 1

- `acting_username` (argument, string, optional)
  Type: string
  
  minLength: 1

- `action_types` (argument, Array<string>, optional)
  Type: Array<string>
  
  minItems: 1
  
  Items:
    Type: string
    
    enum: ["likes","was_liked","topics","replies","responses","mentions","quotes","edits","private_messages_sent","private_messages_received","solved","assigned","linked"]

- `offset` (argument, integer, optional)
  Type: integer
  
  minimum: 0

- `limit` (argument, integer, optional)
  Type: integer
  
  minimum: 1
  
  maximum: 100

Declared MCP annotations:

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

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_user_actions",
    "arguments": {
        "username": "string",
        "acting_username": "string",
        "action_types": [
          "likes"
        ],
        "offset": 0,
        "limit": 1
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_user_actions",
  "arguments": {
    "username": "string",
    "acting_username": "string",
    "action_types": [
      "likes"
    ],
    "offset": 0,
    "limit": 1
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_user_actions", arguments={
  "username": "string",
  "acting_username": "string",
  "action_types": [
    "likes"
  ],
  "offset": 0,
  "limit": 1
})
```


## List Directory Items

`TOOL discourse_list_directory_items`

List user-directory/cohort metrics with authoritative totals and continuation. Supports Discourse periods, ordering, visible groups, page 0-10, and the upstream maximum of 50 rows.

Authentication: no security requirement declared for this operation.

Parameters:

- `period` (argument, string, required)
  Type: string
  
  enum: ["daily","weekly","monthly","quarterly","yearly","all"]

- `order` (argument, string, optional)
  Type: string
  
  pattern: "^[a-z0-9_]+$"

- `ascending` (argument, boolean, optional)
  Type: boolean

- `group` (argument, string, optional)
  Type: string
  
  minLength: 1

- `page` (argument, integer, optional)
  Type: integer
  
  minimum: 0
  
  maximum: 10

- `limit` (argument, integer, optional)
  Type: integer
  
  minimum: 1
  
  maximum: 50

- `name` (argument, string, optional)
  Type: string

- `username` (argument, string, optional)
  Type: string

- `exclude_groups` (argument, Array<string>, optional)
  Type: Array<string>
  
  maxItems: 50
  
  Items:
    Type: string
    
    minLength: 1

- `exclude_usernames` (argument, Array<string>, optional)
  Type: Array<string>
  
  maxItems: 100
  
  Items:
    Type: string
    
    minLength: 1

Declared MCP annotations:

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

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_directory_items",
    "arguments": {
        "period": "daily",
        "order": "string",
        "ascending": true,
        "group": "string",
        "page": 0,
        "limit": 1,
        "name": "string",
        "username": "string",
        "exclude_groups": [
          "string"
        ],
        "exclude_usernames": [
          "string"
        ]
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_directory_items",
  "arguments": {
    "period": "daily",
    "order": "string",
    "ascending": true,
    "group": "string",
    "page": 0,
    "limit": 1,
    "name": "string",
    "username": "string",
    "exclude_groups": [
      "string"
    ],
    "exclude_usernames": [
      "string"
    ]
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_directory_items", arguments={
  "period": "daily",
  "order": "string",
  "ascending": true,
  "group": "string",
  "page": 0,
  "limit": 1,
  "name": "string",
  "username": "string",
  "exclude_groups": [
    "string"
  ],
  "exclude_usernames": [
    "string"
  ]
})
```
