# MCP エンドポイント経由で cite に接続する例 (Python)
import anthropic

client = anthropic.Anthropic()

# cite の MCP サーバーに接続してコーパスを検索
response = client.beta.messages.create(
    model="claude-opus-4-6",
    max_tokens=1024,
    tools=[
        {
            "type": "custom",
            "name": "search_corpus",
            "description": "Search the cite citation graph for documents and annotations",
            "input_schema": {
                "type": "object",
                "properties": {
                    "query": {"type": "string", "description": "Search query"},
                    "corpus_id": {"type": "string", "description": "Corpus ID to search"}
                },
                "required": ["query"]
            }
        }
    ],
    messages=[
        {"role": "user", "content": "このコーパス内で民法第90条を引用している文書を探してください"}
    ]
)
print(response.content)