Skip to main content
Glama

dune_query_archive

Archive saved Dune Analytics queries to organize blockchain data analysis workflows. Specify a query ID to move queries to archived status for better query management.

Instructions

Archive a saved Dune query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
query_idYes

Implementation Reference

  • Registration of the 'dune_query_archive' tool using the FastMCP @app.tool decorator, which defines the tool's metadata including name, title, description, and tags.
    @app.tool(
        name="dune_query_archive",
        title="Archive Saved Query",
        description="Archive a saved Dune query.",
        tags={"dune", "admin"},
    )
  • The main handler function for the 'dune_query_archive' tool. Ensures initialization, calls QUERY_ADMIN_SERVICE.archive(query_id) to perform the archiving, logs the action to query history, and handles errors gracefully.
    def dune_query_archive(query_id: int) -> dict[str, Any]:
        _ensure_initialized()
        assert QUERY_ADMIN_SERVICE is not None
        try:
            result = dict(QUERY_ADMIN_SERVICE.archive(query_id))
            # Log admin action
            if QUERY_HISTORY is not None:
                QUERY_HISTORY.record(
                    execution_id=f"archive_{query_id}",
                    query_type="query_id",
                    query_preview=f"Archived query {query_id}",
                    status="success",
                    duration_ms=0,
                    action_type="admin_action",
                    query_id=query_id,
                    action="archive",
                )
            return result
        except Exception as e:
            # Log error
            if QUERY_HISTORY is not None:
                QUERY_HISTORY.record(
                    execution_id=f"archive_{query_id}",
                    query_type="query_id",
                    query_preview=f"Failed to archive query {query_id}",
                    status="error",
                    duration_ms=0,
                    action_type="admin_action",
                    query_id=query_id,
                    action="archive",
                    error=str(e),
                )
            return error_response(e, context={"tool": "dune_query_archive", "query_id": query_id})

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Evan-Kim2028/spice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server