Skip to main content
Glama

search_public_queries

Find existing SQL queries by keyword to discover relevant table names for data analysis.

Instructions

Search public queries by keyword. Use this to discover table names from existing SQL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the search_public_queries tool. It calls dune_service.search_queries(query), handles errors, and formats the top 10 results as a string.
    @mcp.tool() def search_public_queries(query: str) -> str: """ Search public queries by keyword. Use this to discover table names from existing SQL. """ results = dune_service.search_queries(query) # Handle WAF/Error if isinstance(results, dict) and "error" in results: return f"Error: {results['error']}" if not results: return f"No public queries found matching '{query}'." # Format as string summary summary = [] for q in results[:10]: # Limit to 10 summary.append(f"ID: {q.get('id')} | Name: {q.get('name')} | Owner: {q.get('owner')}") return "\n".join(summary)

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/nice-bills/dune-mcp'

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