Skip to main content
Glama
suthio

Redash MCP Server

by suthio

get_my_queries

Retrieve queries created by your Redash user account, with pagination support for browsing results.

Instructions

Get queries created by the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (starts at 1)
pageSizeNoNumber of results per page

Implementation Reference

  • The MCP tool handler function for 'get_my_queries'. Validates inputs with getMyQueriesSchema and calls redashClient.getMyQueries(page, pageSize), returning JSON-formatted results or an error response.
    async function getMyQueries(params: z.infer<typeof getMyQueriesSchema>) {
      try {
        const result = await redashClient.getMyQueries(params.page, params.pageSize);
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error fetching my queries: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error fetching my queries: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • Zod schema for get_my_queries input validation. Defines optional 'page' (default 1) and 'pageSize' (default 25) numeric parameters.
    const getMyQueriesSchema = z.object({
      page: z.coerce.number().optional().default(1),
      pageSize: z.coerce.number().optional().default(25)
    });
  • src/index.ts:2098-2108 (registration)
    Registration of the 'get_my_queries' tool in the ListToolsRequestSchema handler. Defines the tool name, description ('Get queries created by the current user'), and input schema properties (page, pageSize).
    {
      name: "get_my_queries",
      description: "Get queries created by the current user",
      inputSchema: {
        type: "object",
        properties: {
          page: { type: "number", description: "Page number (starts at 1)" },
          pageSize: { type: "number", description: "Number of results per page" }
        }
      }
    },
  • src/index.ts:2488-2490 (registration)
    Route in the CallToolRequestSchema switch-case that dispatches the 'get_my_queries' tool name to the getMyQueries handler function after schema validation.
    case "get_my_queries":
      logger.debug(`Handling get_my_queries`);
      return await getMyQueries(getMyQueriesSchema.parse(args));
  • The underlying API client method getMyQueries() that makes the HTTP GET request to /api/queries/my with page and page_size params, returning the paginated list of the current user's queries.
    // Get current user's queries
    async getMyQueries(page = 1, pageSize = 25): Promise<{ count: number; page: number; pageSize: number; results: RedashQuery[] }> {
      try {
        const response = await this.client.get('/api/queries/my', {
          params: { page, page_size: pageSize }
        });
        return {
          count: response.data.count,
          page: response.data.page,
          pageSize: response.data.page_size,
          results: response.data.results
        };
      } catch (error) {
        logger.error(`Error fetching my queries: ${error}`);
        throw new Error(`Failed to fetch my queries: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It does not disclose pagination behavior, ordering, or any side effects. The existence of pagination parameters is implied but not explained. This is insufficient for a safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no fluff. It is appropriately sized for a simple retrieval tool, though it could benefit from a brief mention of pagination or return format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description should explain what is returned (e.g., list of query objects with fields). It only states the filtering criterion but omits return structure, making it incomplete for an agent to process results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters (page and pageSize). The description adds no additional meaning beyond the schema, so it meets the baseline. No extra context like required values or constraints is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'queries created by the current user', distinguishing it from tools like list_queries that might return all queries. However, it does not explicitly differentiate from get_favorite_queries or get_recent_queries, lacking sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidance is provided. The description does not specify when to use this tool versus alternatives, and there are no examples or exclusions. An agent would rely solely on the tool name and basic purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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