feat: add list_documents discovery tool

This commit is contained in:
2025-12-03 14:42:45 -05:00
parent c4ddc3b1b0
commit a3167bec63
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1 @@
"""MCP tools for Grist operations."""

View File

@@ -0,0 +1,12 @@
"""Discovery tools - list accessible documents."""
from grist_mcp.auth import Agent
async def list_documents(agent: Agent) -> dict:
"""List documents this agent can access with their permissions."""
documents = [
{"name": scope.document, "permissions": scope.permissions}
for scope in agent._token_obj.scope
]
return {"documents": documents}