gitlab_list_snippets
Browse and filter reusable code snippets from GitLab projects. Retrieve metadata including title, description, and visibility. Supports pagination and project-specific filtering for efficient snippet discovery.
Instructions
List project snippets Returns: Array of snippets with metadata Use when: Browsing code snippets, finding reusable code Pagination: Yes (default 20 per page) Filtering: By project
Example response: [{ "id": 123, "title": "Database Helper", "file_name": "db_helper.py", "description": "Common database operations", "visibility": "private", "author": {"name": "John Doe"}, "created_at": "2023-01-01T00:00:00Z", "web_url": "https://gitlab.com/group/project/snippets/123" }]
Related tools:
- gitlab_get_snippet: Get snippet content
- gitlab_create_snippet: Create new snippet
Input Schema
Name | Required | Description | Default |
---|---|---|---|
page | No | Page number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets | |
per_page | No | Number of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing | |
project_id | No | Project identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted |