Skip to main content
Glama

search_code

Search for code snippets across CERN GitLab repositories globally or within a specific project. Returns matching files with line-level context to find usage examples of libraries, functions, or patterns.

Instructions

Search for code snippets across CERN GitLab repositories. Can search globally across all public projects or within a specific project. Returns matching files with line-level context. Useful for finding usage examples of specific libraries, functions, or patterns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoOptional: Git branch or tag to search within. If omitted, uses the default_ref from configuration (or GitLab's default branch behavior if not configured).
pageNoPage number to retrieve (default: 1)
scopeNoSearch scope: 'blobs' searches file content (default), 'filenames' searches only file names
projectNoOptional: limit search to a specific project. Either a numeric ID or path (e.g. 'atlas/athena'). If omitted, searches across all public projects.
per_pageNoNumber of results to return (default: 20, max: 100)
search_termYesThe code or text to search for
Behavior3/5

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

With no annotations, the description must cover behavioral traits. It notes the tool returns 'matching files with line-level context' and implies read-only behavior, but does not disclose pagination limits, rate limits, authentication requirements, or potential performance impacts of global searches.

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?

Two concise sentences, front-loaded with the core action. Every sentence provides value with no redundancy or fluff.

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

Completeness4/5

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

Given 6 parameters (1 required), full schema coverage, and no output schema, the description adequately explains the tool's high-level behavior and results. Minor gaps remain in explaining when to use project-specific vs. global search, but the schema covers parameter details.

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 provides descriptions for all 6 parameters, so the description adds minimal extra value beyond stating it returns line-level context. The schema already explains scope, project, ref, pagination, etc.

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

Purpose5/5

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

The description clearly states the tool searches for code snippets across CERN GitLab repositories, with global or project-specific scope. It distinguishes itself from sibling tools like search_projects and search_issues by focusing on code content.

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

Usage Guidelines4/5

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

The description mentions global vs. project search and provides a use case for finding usage examples, but does not explicitly state when not to use this tool or mention alternatives like list_project_files or get_file_content.

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/MohamedElashri/cerngitlab-mcp'

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