Skip to main content
Glama

search_repositories

Find GitLab projects by searching with queries to locate repositories based on specific criteria, supporting pagination for result management.

Instructions

Search for GitLab projects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesSearch query
pageNoPage number for pagination (default: 1)
per_pageNoNumber of results per page (default: 20)

Implementation Reference

  • The tool handler in server.ts that receives the request and calls the api.searchProjects function.
    case "search_repositories": {
      const args = SearchRepositoriesSchema.parse(request.params.arguments);
      const results = await api.searchProjects(args.search, args.page, args.per_page);
      return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
    }
  • The actual implementation of searching projects in the API layer.
    export async function searchProjects(query: string, page: number = 1, perPage: number = 20): Promise<GitLabSearchResponse> {
      if (!query?.trim()) {
        throw new Error("Search query is required");
      }
      if (page < 1) {
        throw new Error("Page number must be 1 or greater");
      }
      if (perPage < 1 || perPage > 100) {
        throw new Error("Per page must be between 1 and 100");
      }
    
      const params = buildSearchParams({
        search: query,
        page: page.toString(),
        per_page: perPage.toString()
      });
    
      const projects = await gitlabGet<GitLabRepository[]>("/projects", params);
    
      return GitLabSearchResponseSchema.parse({
        count: projects.length, // GitLab doesn't always provide total in headers
        items: projects
      });
    }
  • The schema definition for the search_repositories tool inputs.
    export const SearchRepositoriesSchema = z.object({
      search: z.string().describe("Search query"), // Changed from query to match GitLab API
      page: z.number().optional().describe("Page number for pagination (default: 1)"),
      per_page: z.number().optional().describe("Number of results per page (default: 20)")
    });
    
    export const SearchGroupsSchema = z.object({
      search: z.string().describe("Search query for groups"),
      page: z.number().optional().describe("Page number for pagination (default: 1)"),
  • src/server.ts:64-68 (registration)
    Tool registration in the server list_tools response.
    {
      name: "search_repositories",
      description: "Search for GitLab projects",
      inputSchema: zodToJsonSchema(SearchRepositoriesSchema)
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Search for GitLab projects' implies a read-only operation but doesn't mention authentication requirements, rate limits, search scope limitations, or what happens with pagination beyond what's in the schema. For a search tool with zero annotation coverage, this is inadequate.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a search tool and front-loads the essential information. Every word earns its place in this minimal description.

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?

Given the tool's purpose (searching repositories), no annotations, and no output schema, the description is insufficient. It doesn't explain what results look like, how search queries work, authentication requirements, or how this differs from other search/list tools. For a search operation that likely returns complex data, more context is needed.

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 schema description coverage is 100%, so the schema already fully documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 ('Search') and resource ('GitLab projects'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'search_groups' or 'search_issues' that also perform searches on different GitLab entities, which prevents a perfect score.

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 provides no guidance on when to use this tool versus alternatives. There are multiple sibling search tools (search_groups, search_issues) and list tools (list_issues, list_labels) that might overlap in functionality, but the description offers no context about when this specific repository search is appropriate versus other options.

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/TheRealChrisThomas/gitlab-mcp-server'

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