Skip to main content
Glama

list_queries

Browse and retrieve all available queries from Redash with pagination support to organize and access your data exploration resources.

Instructions

List all queries in Redash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default: 1)
page_sizeNoNumber of results per page (default: 25)

Implementation Reference

  • The listQueriesTool definition, including the handler function that executes client.listQueries(page, pageSize) and returns the JSON results or error.
    export const listQueriesTool: Tool = { name: 'list_queries', description: 'List all queries in Redash', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (default: 1)', minimum: 1, }, page_size: { type: 'number', description: 'Number of results per page (default: 25)', minimum: 1, maximum: 100, }, }, additionalProperties: false, }, handler: async (args, client) => { try { const page = typeof args.page === 'number' ? args.page : 1; const pageSize = typeof args.page_size === 'number' ? args.page_size : 25; const queries = await client.listQueries(page, pageSize); return { content: [ { type: 'text', text: JSON.stringify(queries, null, 2), } as TextContent, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error listing queries: ${error instanceof Error ? error.message : String(error)}`, } as TextContent, ], isError: true, }; } }, };
  • Input schema defining optional pagination parameters for the list_queries tool.
    inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (default: 1)', minimum: 1, }, page_size: { type: 'number', description: 'Number of results per page (default: 25)', minimum: 1, maximum: 100, }, }, additionalProperties: false, },
  • src/index.ts:59-59 (registration)
    Registration of listQueriesTool in the main tools array used by the MCP server's list_tools and call_tool handlers.
    const tools = [listDataSourcesTool, getDataSourceTool, executeQueryAndWaitTool, listQueriesTool];
  • RedashClient.listQueries helper method that makes the API request to fetch queries with pagination.
    async listQueries(page = 1, pageSize = 25): Promise<Query[]> { const response = await this.request<{ results: Query[] }>( `/api/queries?page=${page}&page_size=${pageSize}` ); return response.results; }

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/jasonsmithj/redash-mcp'

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