feat: add list_documents discovery tool
This commit is contained in:
1
src/grist_mcp/tools/__init__.py
Normal file
1
src/grist_mcp/tools/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""MCP tools for Grist operations."""
|
||||
12
src/grist_mcp/tools/discovery.py
Normal file
12
src/grist_mcp/tools/discovery.py
Normal 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}
|
||||
Reference in New Issue
Block a user