> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Pagination CLI

> CLI commands for paginating MCP tools, resources, and prompts

# MCP Pagination CLI

Command-line interface for paginating through MCP server tools, resources, and prompts.

## Commands Overview

| Command                        | Description                    |
| ------------------------------ | ------------------------------ |
| `praisonai mcp list-tools`     | List tools with pagination     |
| `praisonai mcp list-resources` | List resources with pagination |
| `praisonai mcp list-prompts`   | List prompts with pagination   |

## List Tools with Pagination

### Basic Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List first page of tools (default 50)
praisonai mcp list-tools

# Output:
# Available MCP Tools (50 of 75):
#   • praisonai.workflow.run
#     Execute a PraisonAI workflow
#   ...
# More results available. Use --cursor NTA
```

### Options

| Option              | Description                              | Default |
| ------------------- | ---------------------------------------- | ------- |
| `--limit <n>`       | Maximum tools per page                   | 50      |
| `--cursor <cursor>` | Pagination cursor from previous response | None    |
| `--json`            | Output in JSON format                    | False   |

### Pagination with Cursor

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Get first page with limit
praisonai mcp list-tools --limit 10

# Use cursor from previous response to get next page
praisonai mcp list-tools --cursor NTA --limit 10
```

### JSON Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Get JSON output for programmatic use
praisonai mcp list-tools --json --limit 5
```

**Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "tools": [
    {
      "name": "praisonai.workflow.run",
      "description": "Execute a PraisonAI workflow",
      "inputSchema": {"type": "object"},
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true
      }
    }
  ],
  "nextCursor": "NQ"
}
```

### Iterate Through All Pages

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
#!/bin/bash
# Script to iterate through all tool pages

cursor=""
page=1

while true; do
    echo "=== Page $page ==="
    
    if [ -z "$cursor" ]; then
        result=$(praisonai mcp list-tools --json --limit 10)
    else
        result=$(praisonai mcp list-tools --json --limit 10 --cursor "$cursor")
    fi
    
    echo "$result" | jq '.tools[].name'
    
    cursor=$(echo "$result" | jq -r '.nextCursor // empty')
    
    if [ -z "$cursor" ]; then
        echo "No more pages"
        break
    fi
    
    page=$((page + 1))
done
```

## List Resources with Pagination

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List resources
praisonai mcp list-resources

# With pagination
praisonai mcp list-resources --limit 20

# JSON output
praisonai mcp list-resources --json
```

## List Prompts with Pagination

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List prompts
praisonai mcp list-prompts

# With pagination
praisonai mcp list-prompts --limit 20

# JSON output
praisonai mcp list-prompts --json
```

## Exit Codes

| Code | Meaning                      |
| ---- | ---------------------------- |
| 0    | Success                      |
| 1    | Error (invalid cursor, etc.) |

## Error Handling

### Invalid Cursor

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai mcp list-tools --cursor "invalid!!!"
# Error: Invalid cursor: ...
# Exit code: 1
```

### Out of Range Cursor

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai mcp list-tools --cursor "MTAwMA"  # Offset 1000 when only 50 tools
# Error: Invalid cursor: offset 1000 out of range
# Exit code: 1
```

## Examples

### Quick Tool Count

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Get total tool count
praisonai mcp list-tools --json --limit 1 | jq '.tools | length'
```

### Export All Tools to File

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Export all tools to JSON file
praisonai mcp list-tools --json > tools.json
```

### Filter by Annotation in Shell

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List only read-only tools (using jq)
praisonai mcp list-tools --json | \
  jq '.tools[] | select(.annotations.readOnlyHint == true) | .name'
```

### Combine with Tools Search

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# For more advanced filtering, use tools search
praisonai mcp tools search --read-only --json
```

## See Also

* [MCP Pagination Module](/docs/mcp/mcp-pagination) - Code-based pagination usage
* [MCP Tool Search CLI](/docs/cli/mcp-tool-search) - Search and filter tools via CLI
* [MCP CLI Overview](/docs/cli/mcp) - All MCP CLI commands
