Skip to main content
Glama

list_servers

Discover and filter available MCP servers by search terms or integration types to find compatible tools for your workflow.

Instructions

List MCP servers with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch term to filter servers
integrationsNoFilter by integration slugs
count_per_pageNoNumber of results per page (maximum: 5000)
offsetNoNumber of results to skip for pagination

Implementation Reference

  • The handler function for the 'list_servers' tool. Validates input arguments using isListServersArgs, makes an API call to fetch server list with filters, handles the response by stringifying JSON, and manages errors.
    case "list_servers": {
      if (!isListServersArgs(request.params.arguments)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid arguments for list_servers"
        );
      }
    
      try {
        const response = await this.axiosInstance.get<ListServersResponse>(
          "/servers",
          {
            params: {
              query: request.params.arguments.query,
              "integrations[]": request.params.arguments.integrations,
              count_per_page: request.params.arguments.count_per_page,
              offset: request.params.arguments.offset,
            },
          }
        );
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          return {
            content: [
              {
                type: "text",
                text: `API Error: ${
                  error.response?.data?.error?.message ?? error.message
                }`,
              },
            ],
            isError: true,
          };
        }
        throw error;
      }
    }
  • TypeScript interfaces defining the input arguments (ListServersArgs) and response structure (ListServersResponse) for the list_servers tool.
    interface ListServersArgs {
      query?: string;
      integrations?: string[];
      count_per_page?: number;
      offset?: number;
    }
    
    interface ListServersResponse {
      servers: Array<{
        name: string;
        url: string;
        external_url?: string;
        short_description?: string;
        source_code_url?: string;
        github_stars?: number;
        package_registry?: string;
        package_name?: string;
        package_download_count?: number;
        EXPERIMENTAL_ai_generated_description?: string;
        integrations: Array<{
          name: string;
          slug: string;
          url: string;
        }>;
      }>;
      next?: string;
      total_count: number;
    }
  • src/index.ts:97-125 (registration)
    Registration of the 'list_servers' tool in the ListToolsRequest handler, including name, description, and JSON input schema.
    {
      name: "list_servers",
      description: "List MCP servers with optional filtering",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Search term to filter servers",
          },
          integrations: {
            type: "array",
            items: {
              type: "string",
            },
            description: "Filter by integration slugs",
          },
          count_per_page: {
            type: "number",
            description: "Number of results per page (maximum: 5000)",
            maximum: 5000,
          },
          offset: {
            type: "number",
            description: "Number of results to skip for pagination",
          },
        },
      },
    },
  • Type guard function for validating ListServersArgs input in the handler.
    const isListServersArgs = (args: any): args is ListServersArgs => {
      if (typeof args !== "object" || args === null) return false;
    
      if ("query" in args && typeof args.query !== "string") return false;
      if ("integrations" in args && !Array.isArray(args.integrations)) return false;
      if ("count_per_page" in args && typeof args.count_per_page !== "number")
        return false;
      if ("offset" in args && typeof args.offset !== "number") return false;
    
      return true;
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'List' implies a read operation, it doesn't specify whether this requires authentication, what format the results come in, whether there are rate limits, or how pagination works beyond the offset parameter. The description adds minimal behavioral context beyond the basic action.

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

Conciseness5/5

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

The description is extremely concise - a single sentence that communicates the core functionality without any wasted words. It's front-loaded with the main purpose and efficiently mentions the filtering capability.

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?

For a list tool with 4 parameters and no output schema, the description is insufficient. It doesn't explain what information is returned about servers, how results are structured, or provide any context about what 'MCP servers' are in this system. With no annotations and no output schema, more descriptive context would be helpful.

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?

The input schema has 100% description coverage, so all parameters are documented in the schema itself. The description adds no specific parameter semantics beyond mentioning 'optional filtering' which is already implied by the schema. This meets the baseline for high schema coverage where the description doesn't need to compensate.

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 action ('List') and resource ('MCP servers'), making the tool's purpose immediately understandable. However, it doesn't differentiate from the sibling 'list_integrations' tool, which would require mentioning what distinguishes listing servers from listing integrations.

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?

The description mentions 'optional filtering' which implies some usage context, but provides no explicit guidance on when to use this tool versus alternatives like 'list_integrations' or how to decide between filtering methods. No when-not-to-use scenarios or prerequisites are mentioned.

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/orliesaurus/pulsemcp-server'

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