# AI features

## List AI Features

`TOOL discourse_ai_list_features`

List visible computed Discourse AI modules, feature enabled state, assigned agents, and effective LLMs. Requires admin credentials.

Authentication: no security requirement declared for this operation.

## Examples

### JSON-RPC

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

### TypeScript

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

### Python

```python
result = await session.call_tool("discourse_ai_list_features", arguments={})
```


## Get AI Feature Configuration

`TOOL discourse_ai_get_feature_config`

Resolve a visible feature module ID and return its computed state plus editable settings from its exact ai-features/<module> area. Credential settings are omitted. Requires admin credentials.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `module_id` (required)
  Type: integer | string
  
  anyOf:
    Type: integer
    
    exclusiveMinimum: 0
  
    Type: string
    
    pattern: "^\\d+$"

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_ai_get_feature_config",
    "arguments": {
        "module_id": 0
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_ai_get_feature_config",
  "arguments": {
    "module_id": 0
  }
});
```

### Python

```python
result = await session.call_tool("discourse_ai_get_feature_config", arguments={
  "module_id": 0
})
```


## Update AI Feature Configuration

`TOOL discourse_ai_update_feature_config`

Atomically bulk-update only non-secret settings freshly exposed by one exact AI feature area, with optional compare-before-write original_values. Refreshes effective state afterward. Production behavior changes immediately. Requires admin credentials and write mode.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `module_id` (required)
  Type: integer | string
  
  anyOf:
    Type: integer
    
    exclusiveMinimum: 0
  
    Type: string
    
    pattern: "^\\d+$"

- `settings` (required)
  Type: object
  
  Additional properties: 
    Type: string | number | boolean | Array<string | number>
    
    anyOf:
      Type: string
      
      maxLength: 20000
    
      Type: number
    
      Type: boolean
    
      Type: Array<string | number>
      
      maxItems: 200
      
      Items:
        Type: string | number
        
        anyOf:
          Type: string
          
          maxLength: 2000
        
          Type: number

- `original_values` (optional)
  Type: object
  
  Additional properties: 
    Type: string | number | boolean | Array<string | number>
    
    anyOf:
      Type: string
      
      maxLength: 20000
    
      Type: number
    
      Type: boolean
    
      Type: Array<string | number>
      
      maxItems: 200
      
      Items:
        Type: string | number
        
        anyOf:
          Type: string
          
          maxLength: 2000
        
          Type: number

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_ai_update_feature_config",
    "arguments": {
        "module_id": 0,
        "settings": {},
        "original_values": {}
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_ai_update_feature_config",
  "arguments": {
    "module_id": 0,
    "settings": {},
    "original_values": {}
  }
});
```

### Python

```python
result = await session.call_tool("discourse_ai_update_feature_config", arguments={
  "module_id": 0,
  "settings": {},
  "original_values": {}
})
```
