archive_query
Archive or delete queries in Dune Analytics to manage your workspace and remove outdated data. This tool helps organize your analytics environment by removing unnecessary queries.
Instructions
Archive/Delete a query. (Requires Paid Plan)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query_id | Yes |
Implementation Reference
- src/main.py:176-185 (handler)MCP tool handler for 'archive_query', decorated with @mcp.tool(). Calls dune_service to perform the archiving and handles errors with user-friendly messages.@mcp.tool() def archive_query(query_id: int) -> str: """ Archive/Delete a query. (Requires Paid Plan) """ try: dune_service.archive_query(query_id) return f"Successfully archived Query {query_id}." except Exception as e: return f"Error archiving query: {str(e)}"
- src/services/dune_client.py:412-420 (helper)Helper method in DuneClient service class that proxies the archive_query call to the underlying Dune API client and handles logging.def archive_query(self, query_id: int) -> bool: """ Archives a query. Returns True on success. """ try: return self.client.archive_query(query_id) except Exception as e: logger.error(f"Error archiving query {query_id}: {e}") raise