# Search

## Discourse Search

`TOOL discourse_search`

Search site content. Returns JSON object with results array of matching topics (id, slug, title) and meta (total, has_more).

Authentication: no security requirement declared for this operation.

Parameters:

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

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

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_search",
    "arguments": {
        "query": "string",
        "max_results": 1
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_search",
  "arguments": {
    "query": "string",
    "max_results": 1
  }
});
```

### Python

```python
result = await session.call_tool("discourse_search", arguments={
  "query": "string",
  "max_results": 1
})
```


## Filter Topics

`TOOL discourse_filter_topics`

Discover topics through a filtered, top, or hot view. Filtered uses Discourse TopicsFilter syntax; top uses Discourse's authoritative top score and defaults to weekly; hot is defined exactly as daily top (not sentiment, controversy, or real-time velocity). Returns a uniform rich topic projection and truthful pagination metadata.

Authentication: no security requirement declared for this operation.

Parameters:

- `filter` (argument, string, optional) - TopicsFilter query (required for the filtered view)
  Type: string
  
  TopicsFilter query (required for the filtered view)

- `view` (argument, string, optional)
  Type: string
  
  default: "filtered"
  
  enum: ["filtered","top","hot"]

- `top_period` (argument, string, optional) - Top period (top view only; defaults to weekly)
  Type: string
  
  Top period (top view only; defaults to weekly)
  
  enum: ["daily","weekly","monthly","quarterly","yearly","all"]

- `page` (argument, integer, optional) - Page number (0-based, default: 0)
  Type: integer
  
  Page number (0-based, default: 0)
  
  minimum: 0

- `per_page` (argument, integer, optional) - Items per page (default 20, max 50)
  Type: integer
  
  Items per page (default 20, max 50)
  
  minimum: 1
  
  maximum: 50

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_filter_topics",
    "arguments": {
        "filter": "string",
        "view": "filtered",
        "top_period": "daily",
        "page": 0,
        "per_page": 1
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_filter_topics",
  "arguments": {
    "filter": "string",
    "view": "filtered",
    "top_period": "daily",
    "page": 0,
    "per_page": 1
  }
});
```

### Python

```python
result = await session.call_tool("discourse_filter_topics", arguments={
  "filter": "string",
  "view": "filtered",
  "top_period": "daily",
  "page": 0,
  "per_page": 1
})
```


## Search Posts

`TOOL discourse_search_posts`

Search post-level evidence with Discourse query syntax. Unlike discourse_search, this preserves matched posts, highlighted blurbs, authors, topics, categories, and truthful bounded continuation. This is keyword search, not Discourse AI semantic search.

Authentication: no security requirement declared for this operation.

Parameters:

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

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

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_search_posts",
    "arguments": {
        "query": "string",
        "page": 1
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_search_posts",
  "arguments": {
    "query": "string",
    "page": 1
  }
});
```

### Python

```python
result = await session.call_tool("discourse_search_posts", arguments={
  "query": "string",
  "page": 1
})
```
