Skip to main content
Glama

search_code

Search code snippets across CERN GitLab repositories to find usage examples of libraries, functions, or patterns. Search globally or within specific projects with line-level context.

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

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

With no annotations provided, the description carries the full burden. It discloses the return format ('Returns matching files with line-level context') and search scope, but omits safety characteristics (read-only status), rate limits, or detailed pagination behavior that annotations would typically cover.

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?

Three well-structured sentences with zero waste. The description front-loads the core action, follows with scope constraints, and concludes with return value and use-case utility. Every sentence earns its place.

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 100% schema coverage and no output schema, the description adequately compensates by describing the return value structure ('matching files with line-level context'). It covers the essential behavioral contract for a search tool, though it could further clarify result pagination or result object structure.

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%, establishing a baseline of 3. The description adds high-level semantic context ('globally across all public projects' reinforces the project parameter) but does not elaborate on specific parameter syntax or the 'blobs' vs 'filenames' enum distinction beyond what the schema already provides.

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 opens with a specific verb-resource combination ('Search for code snippets across CERN GitLab repositories') and clearly distinguishes from siblings like search_issues and search_projects by specifying 'code snippets' and 'line-level context' as distinct outputs.

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?

Provides clear use-case guidance ('Useful for finding usage examples of specific libraries, functions, or patterns') and scope context ('globally across all public projects or within a specific project'), though it does not explicitly name alternative tools like get_file_content for when full file retrieval is needed.

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