553c38200a
- Dockerfile: build fable-mcp wheel into /app/dist/ during image build - routes/fable_mcp_dist.py: GET /api/fable-mcp/info + /download endpoints - app.py: register fable_mcp_dist_bp - fable_mcp/tools/admin.py: get_app_logs() hitting /api/admin/logs - fable_mcp/server.py: fable_get_app_logs MCP tool - SettingsView: "Fable MCP" section in API Keys tab with download button and install instructions - client.ts: getFableMcpInfo() helper - ci.yml: add fable-mcp/** to trigger paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
603 B
Python
21 lines
603 B
Python
"""Admin tools: application log access (requires admin API key)."""
|
|
from __future__ import annotations
|
|
|
|
from fable_mcp.client import FableClient
|
|
|
|
|
|
async def get_app_logs(
|
|
client: FableClient,
|
|
category: str = "error",
|
|
limit: int = 20,
|
|
search: str | None = None,
|
|
) -> dict:
|
|
"""Fetch application logs from Fable. Requires an admin-scoped API key.
|
|
|
|
category: "error" | "audit" | "usage" (default: "error")
|
|
"""
|
|
params: dict = {"category": category, "limit": limit}
|
|
if search:
|
|
params["search"] = search
|
|
return await client.get("/api/admin/logs", params=params)
|