Skip to main content
Glama

search_code

Read-only

Search CERN GitLab repositories for code snippets, globally or within a project, to find usage examples of libraries, functions, or patterns 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
refNoOptional: Git branch or tag to search within
pageNoPage number to retrieve
scopeNo'blobs' searches file content (default), 'filenames' searches only file namesblobs
projectNoOptional: limit search to a specific project (ID or path). If omitted, searches across all public projects.
per_pageNoNumber of results to return
search_termYesThe code or text to search for

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv0.3.0
    • addedInput schema / properties / page / default
      Added value: +1
    • changedInput schema / properties / page / description
      Previous value: -"Page number to retrieve (default: 1)"New value: +"Page number to retrieve"
    • addedInput schema / properties / page / title
      Added value: +"Page"
    • addedInput schema / properties / per_page / default
      Added value: +20
    • changedInput schema / properties / per_page / description
      Previous value: -"Number of results to return (default: 20, max: 100)"New value: +"Number of results to return"
    • addedInput schema / properties / per_page / title
      Added value: +"Per Page"
    • addedInput schema / properties / project / default
      Added value: +""
    • changedInput schema / properties / project / description
      Previous value: -"Optional: limit search to a specific project. Either a numeric ID or path (e.g. 'atlas/athena'). If omitted, searches across all public projects."New value: +"Optional: limit search to a specific project (ID or path). If omitted, searches across all public projects."
    • addedInput schema / properties / project / title
      Added value: +"Project"
    • addedInput schema / properties / ref / default
      Added value: +""
    • changedInput schema / properties / ref / description
      Previous value: -"Optional: Git branch or tag to search within. If omitted, uses the default_ref from configuration (or GitLab's default branch behavior if not configured)."New value: +"Optional: Git branch or tag to search within"
    • addedInput schema / properties / ref / title
      Added value: +"Ref"
    • addedInput schema / properties / scope / default
      Added value: +"blobs"
    • changedInput schema / properties / scope / description
      Previous value: -"Search scope: 'blobs' searches file content (default), 'filenames' searches only file names"New value: +"'blobs' searches file content (default), 'filenames' searches only file names"
    • addedInput schema / properties / scope / title
      Added value: +"Scope"
    • addedInput schema / properties / search_term / title
      Added value: +"Search Term"
    • addedInput schema / title
      Added value: +"search_code_fnArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "search_code_fnDictOutput",
      +  "type": "object"
      +}
  2. Changed1 schema field changedv0.2.0
    • changedInput schema / properties / ref / description
      Previous value: -"Optional: Git branch or tag to search within. If omitted, uses the default_ref from configuration (or searches all branches if not configured)."New value: +"Optional: Git branch or tag to search within. If omitted, uses the default_ref from configuration (or GitLab's default branch behavior if not configured)."
  3. First observedv0.1.6

TDQS

A4.3/5.0
Behavior4/5

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

Annotations include readOnlyHint and openWorldHint, which are consistent with the description. The description adds useful behavior beyond those hints: it can search globally or within a specific project, and it returns matching files with line-level context. No contradictions with annotations.

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 concise sentences with no filler. The core action and scope are front-loaded, followed by return value and typical use case. Every sentence adds information.

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

Completeness5/5

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

For a read-only search tool with complete parameter schemas and an output schema, the description covers the essential purpose, scoping options, and return format. Pagination and ref details are already in the schema, so nothing critical is missing for an agent to call it correctly.

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%, so the parameters are already fully documented. The description slightly reinforces the project parameter's global-vs-scoped behavior but does not add meaningful semantics beyond the schema. Baseline 3 is appropriate.

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?

States a specific verb ('Search') and resource ('code snippets across CERN GitLab repositories'), clearly distinguishing it from sibling tools like search_projects and search_issues. The description also clarifies the two modes (global vs project-scoped) and the return type (files with line-level context).

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 context: 'Useful for finding usage examples of specific libraries, functions, or patterns.' It implies when to use this tool, though it does not explicitly name alternatives or say when not to use it. The global/project scope options add practical usage guidance.

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