dune_query_unarchive
Restore archived Dune Analytics queries to make them accessible for blockchain data analysis and query management workflows.
Instructions
Unarchive a saved Dune query.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query_id | Yes |
Implementation Reference
- src/spice_mcp/mcp/server.py:978-983 (registration)Registration of the dune_query_unarchive tool using FastMCP @app.tool decorator.@app.tool( name="dune_query_unarchive", title="Unarchive Saved Query", description="Unarchive a saved Dune query.", tags={"dune", "admin"}, )
- src/spice_mcp/mcp/server.py:984-1017 (handler)Handler function that executes the unarchive operation via QUERY_ADMIN_SERVICE, logs success/error to query history, and returns the result or error response.def dune_query_unarchive(query_id: int) -> dict[str, Any]: _ensure_initialized() assert QUERY_ADMIN_SERVICE is not None try: result = dict(QUERY_ADMIN_SERVICE.unarchive(query_id)) # Log admin action if QUERY_HISTORY is not None: QUERY_HISTORY.record( execution_id=f"unarchive_{query_id}", query_type="query_id", query_preview=f"Unarchived query {query_id}", status="success", duration_ms=0, action_type="admin_action", query_id=query_id, action="unarchive", ) return result except Exception as e: # Log error if QUERY_HISTORY is not None: QUERY_HISTORY.record( execution_id=f"unarchive_{query_id}", query_type="query_id", query_preview=f"Failed to unarchive query {query_id}", status="error", duration_ms=0, action_type="admin_action", query_id=query_id, action="unarchive", error=str(e), ) return error_response(e, context={"tool": "dune_query_unarchive", "query_id": query_id})