search_code
Search code snippets across CERN GitLab repositories globally or within a specific project, returning matching files 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"search_term": "<search_term>"
},
"name": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional: Git branch or tag to search within | |
| page | No | Page number to retrieve | |
| scope | No | 'blobs' searches file content (default), 'filenames' searches only file names | blobs |
| project | No | Optional: limit search to a specific project (ID or path). If omitted, searches across all public projects. | |
| per_page | No | Number of results to return | |
| search_term | Yes | The code or text to search for |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||