{
  "$schema": "../../profile-schema.json",
  "profile_name": "gitlab-optimized-oauth",
  "profile_id": "gitlab-optimized",
  "profile_aliases": ["gitlab-optimized-oauth"],
  "openapi_spec_path": "./openapi.yaml",
  "description": "Minimal CRUD-style tool set grouped by read/write actions. Special operations like GLQL are separate.",

  "parameter_aliases": {
    "id": ["project_id", "group_id", "resource_id"],
    "badge_id": ["badge_id"],
    "branch": ["branch"],
    "user_id": ["user_id"],
    "job_id": ["job_id"],
    "merge_request_iid": ["iid", "mr_iid"],
    "issue_iid": ["iid"],
    "note_id": ["comment_id"],
    "file_path": ["path", "filepath"],
    "path": ["file_path", "filepath"],
    "pipeline_id": ["pipeline"],
    "discussion_id": ["discussion"],
    "hook_id": ["webhook_id"],
    "snippet_id": ["snippet"],
    "tag_name": ["tag"]
  },

  "tools": [
    {
      "name": "retrieve_content",
      "description": "Read-only access to GitLab content (projects, issues, merge requests, snippets, repository, members, labels, milestones, pipelines, hooks, variables). Actions: 'list_projects', 'get_project', 'list_project_members', 'list_project_hooks', 'get_project_hook', 'list_project_variables', 'get_project_variable', 'list_issues', 'list_issues_global', 'get_issue', 'list_issue_notes', 'get_issue_note', 'list_issue_discussions', 'get_issue_discussion', 'list_issue_note_award_emoji', 'get_issue_note_award_emoji', 'list_merge_requests', 'get_merge_request', 'list_merge_request_notes', 'get_merge_request_note', 'list_merge_request_commits', 'list_merge_request_diffs', 'list_merge_request_raw_diffs', 'list_merge_request_pipelines', 'list_snippets', 'get_snippet', 'download_snippet', 'get_file', 'download_file', 'list_repository_tree', 'compare_refs', 'get_commit', 'list_pipelines', 'list_pipeline_jobs', 'get_job', 'download_job_artifacts', 'download_job_artifact', 'list_project_labels', 'list_group_labels', 'list_project_milestones', 'list_group_milestones'.",
      "metadata_params": ["action", "project_id", "issue_iid", "merge_request_iid", "note_id", "snippet_id", "file_path", "pipeline_id", "job_id", "hook_id", "key"],
      "operations": {
        "list_projects": "getApiV4Projects",
        "get_project": "getApiV4ProjectsId",
        "list_project_members": "getApiV4ProjectsIdMembers",
        "list_project_hooks": "getApiV4ProjectsIdHooks",
        "get_project_hook": "getApiV4ProjectsIdHooksHookId",
        "list_project_variables": "getApiV4ProjectsIdVariables",
        "get_project_variable": "getApiV4ProjectsIdVariablesKey",
        "list_issues": "getApiV4ProjectsIdIssues",
        "list_issues_global": "getApiV4Issues",
        "get_issue": "getApiV4ProjectsIdIssuesIssueIid",
        "list_issue_notes": "getApiV4ProjectsIdIssuesIssueIidNotes",
        "get_issue_note": "getApiV4ProjectsIdIssuesIssueIidNotesNoteId",
        "list_issue_discussions": "getApiV4ProjectsIdIssuesIssueIidDiscussions",
        "get_issue_discussion": "getApiV4ProjectsIdIssuesIssueIidDiscussionsDiscussionId",
        "list_issue_note_award_emoji": "getApiV4ProjectsIdIssuesIssueIidNotesNoteIdAwardEmoji",
        "get_issue_note_award_emoji": "getApiV4ProjectsIdIssuesIssueIidNotesNoteIdAwardEmojiAwardId",
        "list_merge_requests": "getApiV4ProjectsIdMergeRequests",
        "get_merge_request": "getApiV4ProjectsIdMergeRequestsMergeRequestIid",
        "list_merge_request_notes": "getApiV4ProjectsIdMergeRequestsMergeRequestIidNotes",
        "get_merge_request_note": "getApiV4ProjectsIdMergeRequestsMergeRequestIidNotesNoteId",
        "list_merge_request_commits": "getApiV4ProjectsIdMergeRequestsMergeRequestIidCommits",
        "list_merge_request_diffs": "getApiV4ProjectsIdMergeRequestsMergeRequestIidDiffs",
        "list_merge_request_raw_diffs": "getApiV4ProjectsIdMergeRequestsMergeRequestIidRawDiffs",
        "list_merge_request_pipelines": "getApiV4ProjectsIdMergeRequestsMergeRequestIidPipelines",
        "list_snippets": "getApiV4ProjectsIdSnippets",
        "get_snippet": "getApiV4ProjectsIdSnippetsSnippetId",
        "download_snippet": {
          "type": "proxy_download",
          "metadata_endpoint": "getApiV4ProjectsIdSnippetsSnippetId",
          "download_endpoint": "getApiV4ProjectsIdSnippetsSnippetIdRaw"
        },
        "get_file": "getApiV4ProjectsIdRepositoryFilesFilePath",
        "download_file": "getApiV4ProjectsIdRepositoryFilesFilePathRaw",
        "list_repository_tree": "getApiV4ProjectsIdRepositoryTree",
        "compare_refs": "getApiV4ProjectsIdRepositoryCompare",
        "get_commit": "getApiV4ProjectsIdRepositoryCommitsSha",
        "list_pipelines": "getApiV4ProjectsIdPipelines",
        "list_pipeline_jobs": "getApiV4ProjectsIdPipelinesPipelineIdJobs",
        "get_job": "getSingleJob",
        "download_job_artifacts": {
          "type": "proxy_download",
          "metadata_endpoint": "getSingleJob",
          "download_endpoint": "getApiV4ProjectsIdJobsJobIdArtifacts"
        },
        "download_job_artifact": {
          "type": "proxy_download",
          "metadata_endpoint": "getSingleJob",
          "download_endpoint": "getApiV4ProjectsIdJobsJobIdArtifactsArtifactPath"
        },
        "list_project_labels": "getApiV4ProjectsIdLabels",
        "list_group_labels": "getApiV4GroupsIdLabels",
        "list_project_milestones": "getApiV4ProjectsIdMilestones",
        "list_group_milestones": "getApiV4GroupsIdMilestones"
      },
      "response_fields": {
        "list_projects": ["id", "name", "path", "path_with_namespace", "description", "visibility", "web_url", "last_activity_at", "star_count", "forks_count", "avatar_url", "namespace"],
        "list_project_members": ["id", "name", "username", "access_level"],
        "list_project_hooks": ["id", "url", "push_events", "issues_events", "merge_requests_events"],
        "get_project_hook": ["id", "url", "push_events", "issues_events", "merge_requests_events"],
        "list_project_variables": ["key", "value", "protected", "masked", "environment_scope"],
        "get_project_variable": ["key", "value", "protected", "masked", "environment_scope"],
        "list_issues": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "list_issues_global": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "get_issue": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "list_issue_notes": ["id", "body", "author", "created_at", "updated_at", "system", "confidential"],
        "get_issue_note": ["id", "body", "author", "created_at", "updated_at", "system", "confidential", "attachment"],
        "list_issue_discussions": ["id", "notes", "resolved"],
        "get_issue_discussion": ["id", "notes", "resolved"],
        "list_issue_note_award_emoji": ["id", "name", "user", "created_at"],
        "get_issue_note_award_emoji": ["id", "name", "user", "created_at"],
        "list_merge_requests": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "get_merge_request": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "list_merge_request_notes": ["id", "body", "author", "created_at", "updated_at", "system", "confidential"],
        "get_merge_request_note": ["id", "body", "author", "created_at", "updated_at", "system", "confidential", "attachment"],
        "list_merge_request_commits": ["id", "short_id", "title", "message", "author_name", "authored_date", "committed_date"],
        "list_merge_request_diffs": ["old_path", "new_path", "new_file", "renamed_file", "deleted_file", "diff"],
        "list_merge_request_pipelines": ["id", "status", "ref", "sha", "web_url"],
        "list_snippets": ["id", "title", "file_name", "visibility"],
        "get_snippet": ["id", "title", "file_name", "description", "visibility"],
        "get_file": ["file_name", "file_path", "size", "encoding", "content", "ref", "blob_id", "commit_id", "last_commit_id"],
        "list_pipelines": ["id", "status", "ref", "web_url"],
        "list_pipeline_jobs": ["id", "status", "stage", "name", "ref", "web_url"],
        "get_job": ["id", "status", "stage", "name", "ref", "web_url"],
        "list_project_labels": ["id", "name", "color", "description"],
        "list_group_labels": ["id", "name", "color", "description"],
        "list_project_milestones": ["id", "iid", "title", "state"],
        "list_group_milestones": ["id", "iid", "title", "state"]
      },
      "parameters": {
        "action": {
          "type": "string",
          "enum": ["list_projects", "get_project", "list_project_members", "list_project_hooks", "get_project_hook", "list_project_variables", "get_project_variable", "list_issues", "list_issues_global", "get_issue", "list_issue_notes", "get_issue_note", "list_issue_discussions", "get_issue_discussion", "list_issue_note_award_emoji", "get_issue_note_award_emoji", "list_merge_requests", "get_merge_request", "list_merge_request_notes", "get_merge_request_note", "list_merge_request_commits", "list_merge_request_diffs", "list_merge_request_raw_diffs", "list_merge_request_pipelines", "list_snippets", "get_snippet", "download_snippet", "get_file", "download_file", "list_repository_tree", "compare_refs", "get_commit", "list_pipelines", "list_pipeline_jobs", "get_job", "download_job_artifacts", "download_job_artifact", "list_project_labels", "list_group_labels", "list_project_milestones", "list_group_milestones"],
          "description": "Action to perform",
          "required": true
        },
        "owned": {
          "type": "boolean",
          "description": "Limit by projects explicitly owned by the current user",
          "required_for": ["list_projects"]
        },
        "membership": {
          "type": "boolean",
          "description": "Limit by projects that the current user is a member of",
          "required_for": ["list_projects"]
        },
        "project_id": {
          "type": "string",
          "description": "Project ID. Use numeric ID (e.g. '123') or URL-encoded path (e.g. 'group%2Fproject').",
          "required_for": ["get_project", "list_project_members", "list_project_hooks", "get_project_hook", "list_project_variables", "get_project_variable", "list_issues", "get_issue", "list_issue_notes", "get_issue_note", "list_issue_discussions", "get_issue_discussion", "list_issue_note_award_emoji", "get_issue_note_award_emoji", "list_merge_requests", "get_merge_request", "list_merge_request_notes", "get_merge_request_note", "list_merge_request_commits", "list_merge_request_diffs", "list_merge_request_raw_diffs", "list_merge_request_pipelines", "list_snippets", "get_snippet", "download_snippet", "get_file", "download_file", "list_repository_tree", "compare_refs", "get_commit", "list_pipelines", "list_pipeline_jobs", "get_job", "download_job_artifacts", "download_job_artifact", "list_project_labels", "list_project_milestones"],
          "example": "123"
        },
        "issue_iid": {
          "type": "integer",
          "description": "The internal ID of the issue",
          "required_for": ["get_issue", "list_issue_notes", "get_issue_note", "list_issue_discussions", "get_issue_discussion", "list_issue_note_award_emoji", "get_issue_note_award_emoji"]
        },
        "merge_request_iid": {
          "type": "integer",
          "description": "The internal ID of the merge request",
          "required_for": ["get_merge_request", "list_merge_request_notes", "get_merge_request_note", "list_merge_request_commits", "list_merge_request_diffs", "list_merge_request_raw_diffs", "list_merge_request_pipelines"]
        },
        "note_id": {
          "type": "integer",
          "description": "The ID of the note",
          "required_for": ["get_issue_note", "get_merge_request_note", "list_issue_note_award_emoji", "get_issue_note_award_emoji"]
        },
        "discussion_id": {
          "type": "string",
          "description": "The ID of the discussion",
          "required_for": ["get_issue_discussion"]
        },
        "award_id": {
          "type": "integer",
          "description": "The ID of the award emoji",
          "required_for": ["get_issue_note_award_emoji"]
        },
        "hook_id": {
          "type": "integer",
          "description": "The ID of the project hook",
          "required_for": ["get_project_hook"]
        },
        "key": {
          "type": "string",
          "description": "Project variable key",
          "required_for": ["get_project_variable"]
        },
        "group_id": {
          "type": "string",
          "description": "Group ID",
          "required_for": ["list_group_labels", "list_group_milestones"]
        },
        "snippet_id": {
          "type": "integer",
          "description": "Snippet ID",
          "required_for": ["get_snippet", "download_snippet"]
        },
        "file_path": {
          "type": "string",
          "description": "URL-encoded full path to the file, e.g., 'src%2Findex.js'. Use %2F instead of '/'.",
          "required_for": ["get_file", "download_file"]
        },
        "ref": {
          "type": "string",
          "description": "Branch name, tag, or commit SHA to read from",
          "required_for": ["get_file", "download_file"],
          "example": "main"
        },
        "path": {
          "type": "string",
          "description": "Directory path within repository (for list_repository_tree)"
        },
        "from": {
          "type": "string",
          "description": "Source ref (for compare_refs)",
          "required_for": ["compare_refs"]
        },
        "to": {
          "type": "string",
          "description": "Target ref (for compare_refs)",
          "required_for": ["compare_refs"]
        },
        "sha": {
          "type": "string",
          "description": "Commit SHA (for get_commit)",
          "required_for": ["get_commit"]
        },
        "pipeline_id": {
          "type": "integer",
          "description": "Pipeline ID (for list_pipeline_jobs)",
          "required_for": ["list_pipeline_jobs"]
        },
        "job_id": {
          "type": "integer",
          "description": "Job ID (for get_job or artifact download)",
          "required_for": ["get_job", "download_job_artifacts", "download_job_artifact"]
        },
        "artifact_path": {
          "type": "string",
          "description": "Path to a file inside the job artifacts archive",
          "required_for": ["download_job_artifact"]
        },
        "state": {
          "type": "string",
          "enum": ["opened", "closed", "merged", "locked", "all"],
          "description": "Filter by issue or merge request state",
          "default": "opened",
          "required_for": ["list_issues", "list_issues_global", "list_merge_requests"]
        },
        "scope": {
          "type": "string",
          "enum": ["created_by_me", "assigned_to_me", "reviews_for_me", "all"],
          "description": "Filter by scope (issues or merge requests)"
        },
        "search": {
          "type": "string",
          "description": "Search projects, issues, or merge requests by title or description"
        },
        "in": {
          "type": "string",
          "description": "Search scope for issues or merge requests (title, description, or title,description)"
        },
        "labels": {
          "type": "string",
          "description": "Filter by labels (comma-separated)"
        },
        "milestone": {
          "type": "string",
          "description": "Filter by milestone title"
        },
        "milestone_id": {
          "type": "string",
          "description": "Filter by milestone ID or special values like None/Any (issues)"
        },
        "assignee_id": {
          "type": "integer",
          "description": "Filter by assignee ID"
        },
        "assignee_username": {
          "type": "string",
          "description": "Filter by assignee username (single or comma-separated)"
        },
        "author_id": {
          "type": "integer",
          "description": "Filter by author ID"
        },
        "author_username": {
          "type": "string",
          "description": "Filter by author username"
        },
        "reviewer_id": {
          "type": "integer",
          "description": "Filter by reviewer ID (merge requests)"
        },
        "reviewer_username": {
          "type": "string",
          "description": "Filter by reviewer username (merge requests)"
        },
        "source_branch": {
          "type": "string",
          "description": "Filter by source branch (merge requests)"
        },
        "target_branch": {
          "type": "string",
          "description": "Filter by target branch (merge requests)"
        },
        "wip": {
          "type": "string",
          "description": "Filter draft merge requests (yes or no)"
        },
        "view": {
          "type": "string",
          "description": "Return simplified merge request fields (simple)"
        },
        "confidential": {
          "type": "boolean",
          "description": "Filter confidential issues"
        },
        "my_reaction_emoji": {
          "type": "string",
          "description": "Filter by your reaction emoji"
        },
        "non_archived": {
          "type": "boolean",
          "description": "Return items only from non-archived projects"
        },
        "order_by": {
          "type": "string",
          "description": "Order results by supported fields"
        },
        "sort": {
          "type": "string",
          "description": "Sort results in asc or desc order"
        },
        "updated_after": {
          "type": "string",
          "description": "Return items updated on or after the given time (ISO 8601)"
        },
        "updated_before": {
          "type": "string",
          "description": "Return items updated on or before the given time (ISO 8601)"
        },
        "created_after": {
          "type": "string",
          "description": "Return merge requests created on or after the given time (ISO 8601)"
        },
        "created_before": {
          "type": "string",
          "description": "Return merge requests created on or before the given time (ISO 8601)"
        },
        "with_labels_details": {
          "type": "boolean",
          "description": "Include extra label details in list responses"
        },
        "activity_filter": {
          "type": "string",
          "description": "Filter issue notes by activity type (all_notes, only_comments, only_activity)"
        },
        "page": {
          "type": "integer",
          "description": "Page number for pagination",
          "default": 1
        },
        "per_page": {
          "type": "integer",
          "description": "Items per page (recommended max 100)",
          "default": 50
        },
        "archived": {
          "type": "boolean",
          "description": "Limit by archived status"
        },
        "id_after": {
          "type": "integer",
          "description": "Limit results to projects with IDs greater than the specified ID"
        },
        "id_before": {
          "type": "integer",
          "description": "Limit results to projects with IDs less than the specified ID"
        },
        "min_access_level": {
          "type": "integer",
          "description": "Limit to projects with at least the specified access level"
        },
        "owned": {
          "type": "boolean",
          "description": "Limit to projects owned by current user"
        },
        "membership": {
          "type": "boolean",
          "description": "Limit to projects current user is a member of"
        },
        "simple": {
          "type": "boolean",
          "description": "Return only limited fields for each project"
        }
      }
    },

    {
      "name": "create_content",
      "description": "Create GitLab content. Actions: 'create_issue', 'create_merge_request', 'create_issue_note', 'create_merge_request_note', 'create_issue_discussion', 'reply_issue_discussion', 'create_issue_note_award_emoji', 'create_merge_request_pipeline', 'create_file', 'create_project_variable', 'create_project_hook'.",
      "metadata_params": ["action", "project_id", "issue_iid", "merge_request_iid"],
      "operations": {
        "create_issue": "postApiV4ProjectsIdIssues",
        "create_merge_request": "postApiV4ProjectsIdMergeRequests",
        "create_issue_note": "postApiV4ProjectsIdIssuesIssueIidNotes",
        "create_merge_request_note": "postApiV4ProjectsIdMergeRequestsMergeRequestIidNotes",
        "create_issue_discussion": "postApiV4ProjectsIdIssuesIssueIidDiscussions",
        "reply_issue_discussion": "postApiV4ProjectsIdIssuesIssueIidDiscussionsDiscussionIdNotes",
        "create_issue_note_award_emoji": "postApiV4ProjectsIdIssuesIssueIidNotesNoteIdAwardEmoji",
        "create_merge_request_pipeline": "postApiV4ProjectsIdMergeRequestsMergeRequestIidPipelines",
        "create_file": "postApiV4ProjectsIdRepositoryFilesFilePath",
        "create_project_variable": "postApiV4ProjectsIdVariables",
        "create_project_hook": "postApiV4ProjectsIdHooks"
      },
      "response_fields": {
        "create_issue": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at"],
        "create_merge_request": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at"],
        "create_issue_note": ["id", "body", "author", "created_at", "system", "confidential"],
        "create_merge_request_note": ["id", "body", "author", "created_at", "system", "confidential"],
        "create_issue_discussion": ["id", "notes", "resolved"],
        "reply_issue_discussion": ["id", "notes", "resolved"],
        "create_issue_note_award_emoji": ["id", "name", "user", "created_at"],
        "create_merge_request_pipeline": ["id", "status", "ref", "sha", "web_url"],
        "create_file": ["file_name", "file_path", "size", "encoding", "content", "ref", "blob_id", "commit_id", "last_commit_id"],
        "create_project_variable": ["key", "value", "protected", "masked", "environment_scope"],
        "create_project_hook": ["id", "url", "push_events", "issues_events", "merge_requests_events"]
      },
      "parameters": {
        "action": {
          "type": "string",
          "enum": ["create_issue", "create_merge_request", "create_issue_note", "create_merge_request_note", "create_issue_discussion", "reply_issue_discussion", "create_issue_note_award_emoji", "create_merge_request_pipeline", "create_file", "create_project_variable", "create_project_hook"],
          "description": "Action to perform",
          "required": true
        },
        "project_id": {
          "type": "string",
          "description": "Project ID. Use numeric ID (e.g. '123') or URL-encoded path (e.g. 'group%2Fproject').",
          "required": true,
          "example": "123"
        },
        "issue_iid": {
          "type": "integer",
          "description": "The internal ID of the issue",
          "required_for": ["create_issue_note", "create_issue_discussion", "reply_issue_discussion", "create_issue_note_award_emoji"]
        },
        "merge_request_iid": {
          "type": "integer",
          "description": "The internal ID of the merge request",
          "required_for": ["create_merge_request_note", "create_merge_request_pipeline"]
        },
        "discussion_id": {
          "type": "string",
          "description": "The ID of the discussion",
          "required_for": ["reply_issue_discussion"]
        },
        "note_id": {
          "type": "integer",
          "description": "The ID of the note",
          "required_for": ["create_issue_note_award_emoji"]
        },
        "name": {
          "type": "string",
          "description": "Emoji name (for award emoji actions)",
          "required_for": ["create_issue_note_award_emoji"]
        },
        "title": {
          "type": "string",
          "description": "Title",
          "required_for": ["create_issue", "create_merge_request"],
          "example": "Implement new feature"
        },
        "description": {
          "type": "string",
          "description": "Description",
          "example": "This implements the new feature requested by the team."
        },
        "source_branch": {
          "type": "string",
          "description": "Source branch (required for create_merge_request)",
          "required_for": ["create_merge_request"],
          "example": "feature/new-feature"
        },
        "target_branch": {
          "type": "string",
          "description": "Target branch (required for create_merge_request)",
          "required_for": ["create_merge_request"],
          "example": "main"
        },
        "body": {
          "type": "string",
          "description": "Note body",
          "required_for": ["create_issue_note", "create_merge_request_note", "create_issue_discussion", "reply_issue_discussion"],
          "example": "Looks good to me."
        },
        "assignee_id": {
          "type": "integer",
          "description": "The ID of the user to assign the issue to (optional for create_issue)",
          "example": 123
        },
        "assignee_ids": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "The IDs of the users to assign the issue to (optional for create_issue)",
          "example": [123, 456]
        },
        "labels": {
          "type": "string",
          "description": "Labels to be added (comma-separated)",
          "example": "bug,feature,frontend"
        },
        "reviewer_ids": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "The IDs of the users to review the merge request (optional for create_merge_request)"
        },
        "file_path": {
          "type": "string",
          "description": "URL-encoded full path to the file, e.g., 'src%2Findex.js'. Use %2F instead of '/'.",
          "required_for": ["create_file"]
        },
        "branch": {
          "type": "string",
          "description": "Branch name for file operations",
          "required_for": ["create_file"]
        },
        "content": {
          "type": "string",
          "description": "File content",
          "required_for": ["create_file"]
        },
        "commit_message": {
          "type": "string",
          "description": "Commit message",
          "required_for": ["create_file"]
        },
        "key": {
          "type": "string",
          "description": "Project variable key",
          "required_for": ["create_project_variable"]
        },
        "value": {
          "type": "string",
          "description": "Project variable value",
          "required_for": ["create_project_variable"]
        },
        "protected": {
          "type": "boolean",
          "description": "Whether the variable is protected"
        },
        "masked": {
          "type": "boolean",
          "description": "Whether the variable is masked"
        },
        "environment_scope": {
          "type": "string",
          "description": "Environment scope for the variable"
        },
        "url": {
          "type": "string",
          "description": "Hook URL",
          "required_for": ["create_project_hook"]
        },
        "push_events": {
          "type": "boolean",
          "description": "Enable push events"
        },
        "issues_events": {
          "type": "boolean",
          "description": "Enable issues events"
        },
        "merge_requests_events": {
          "type": "boolean",
          "description": "Enable merge requests events"
        }
      }
    },

    {
      "name": "update_content",
      "description": "Update GitLab content. Actions: 'update_issue', 'update_merge_request', 'update_issue_note', 'update_merge_request_note', 'set_issue_discussion_resolved', 'update_file', 'retry_job', 'cancel_job', 'update_project_variable', 'update_project_hook'.",
      "metadata_params": ["action", "project_id", "merge_request_iid", "issue_iid", "note_id", "job_id", "key", "hook_id"],
      "operations": {
        "update_issue": "putApiV4ProjectsIdIssuesIssueIid",
        "update_merge_request": "putApiV4ProjectsIdMergeRequestsMergeRequestIid",
        "update_issue_note": "putApiV4ProjectsIdIssuesIssueIidNotesNoteId",
        "update_merge_request_note": "putApiV4ProjectsIdMergeRequestsMergeRequestIidNotesNoteId",
        "set_issue_discussion_resolved": "putApiV4ProjectsIdIssuesIssueIidDiscussionsDiscussionId",
        "update_file": "putApiV4ProjectsIdRepositoryFilesFilePath",
        "retry_job": "postApiV4ProjectsIdJobsJobIdRetry",
        "cancel_job": "postApiV4ProjectsIdJobsJobIdCancel",
        "update_project_variable": "putApiV4ProjectsIdVariablesKey",
        "update_project_hook": "putApiV4ProjectsIdHooksHookId"
      },
      "response_fields": {
        "update_issue": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "update_merge_request": ["id", "iid", "title", "description", "state", "web_url", "author", "created_at", "updated_at"],
        "update_issue_note": ["id", "body", "author", "created_at", "updated_at", "system", "confidential"],
        "update_merge_request_note": ["id", "body", "author", "created_at", "updated_at", "system", "confidential"],
        "set_issue_discussion_resolved": ["id", "notes", "resolved"],
        "update_file": ["file_name", "file_path", "size", "encoding", "content", "ref", "blob_id", "commit_id", "last_commit_id"],
        "update_project_variable": ["key", "value", "protected", "masked", "environment_scope"],
        "update_project_hook": ["id", "url", "push_events", "issues_events", "merge_requests_events"]
      },
      "parameters": {
        "action": {
          "type": "string",
          "enum": ["update_issue", "update_merge_request", "update_issue_note", "update_merge_request_note", "set_issue_discussion_resolved", "update_file", "retry_job", "cancel_job", "update_project_variable", "update_project_hook"],
          "description": "Action to perform",
          "required": true
        },
        "project_id": {
          "type": "string",
          "description": "Project ID. Use numeric ID (e.g. '123') or URL-encoded path (e.g. 'group%2Fproject').",
          "required": true,
          "example": "123"
        },
        "merge_request_iid": {
          "type": "integer",
          "description": "The internal ID of the merge request",
          "required_for": ["update_merge_request", "update_merge_request_note"]
        },
        "issue_iid": {
          "type": "integer",
          "description": "The internal ID of the issue",
          "required_for": ["update_issue", "update_issue_note", "set_issue_discussion_resolved"]
        },
        "note_id": {
          "type": "integer",
          "description": "The ID of the note",
          "required_for": ["update_issue_note", "update_merge_request_note"]
        },
        "discussion_id": {
          "type": "string",
          "description": "The ID of the discussion",
          "required_for": ["set_issue_discussion_resolved"]
        },
        "job_id": {
          "type": "integer",
          "description": "Job ID (for retry or cancel)",
          "required_for": ["retry_job", "cancel_job"]
        },
        "key": {
          "type": "string",
          "description": "Project variable key",
          "required_for": ["update_project_variable"]
        },
        "hook_id": {
          "type": "integer",
          "description": "Hook ID",
          "required_for": ["update_project_hook"]
        },
        "title": {
          "type": "string",
          "description": "Title",
          "example": "Update title"
        },
        "description": {
          "type": "string",
          "description": "Description"
        },
        "state_event": {
          "type": "string",
          "enum": ["reopen", "close"],
          "description": "State event (update_issue or update_merge_request)"
        },
        "assignee_id": {
          "type": "integer",
          "description": "The ID of the user to assign the merge request to (optional for update_merge_request)"
        },
        "assignee_ids": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "The IDs of the users to assign the merge request to (optional for update_merge_request)"
        },
        "reviewer_ids": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "The IDs of the users to review the merge request (optional for update_merge_request)"
        },
        "body": {
          "type": "string",
          "description": "Note body",
          "required_for": ["update_issue_note", "update_merge_request_note"],
          "example": "Updating the comment."
        },
        "resolved": {
          "type": "boolean",
          "description": "Resolve or unresolve discussion",
          "required_for": ["set_issue_discussion_resolved"]
        },
        "file_path": {
          "type": "string",
          "description": "URL-encoded full path to the file, e.g., 'src%2Findex.js'. Use %2F instead of '/'.",
          "required_for": ["update_file"]
        },
        "branch": {
          "type": "string",
          "description": "Branch name for file operations",
          "required_for": ["update_file"]
        },
        "content": {
          "type": "string",
          "description": "File content",
          "required_for": ["update_file"]
        },
        "commit_message": {
          "type": "string",
          "description": "Commit message",
          "required_for": ["update_file"]
        },
        "value": {
          "type": "string",
          "description": "Project variable value",
          "required_for": ["update_project_variable"]
        },
        "protected": {
          "type": "boolean",
          "description": "Whether the variable is protected"
        },
        "masked": {
          "type": "boolean",
          "description": "Whether the variable is masked"
        },
        "environment_scope": {
          "type": "string",
          "description": "Environment scope for the variable"
        },
        "url": {
          "type": "string",
          "description": "Hook URL",
          "required_for": ["update_project_hook"]
        },
        "push_events": {
          "type": "boolean",
          "description": "Enable push events"
        },
        "issues_events": {
          "type": "boolean",
          "description": "Enable issues events"
        },
        "merge_requests_events": {
          "type": "boolean",
          "description": "Enable merge requests events"
        }
      }
    },

    {
      "name": "delete_content",
      "description": "Delete GitLab content. Actions: 'delete_issue', 'delete_merge_request', 'delete_issue_note', 'delete_merge_request_note', 'delete_issue_discussion', 'delete_issue_note_award_emoji', 'delete_file', 'delete_project_variable', 'delete_project_hook'.",
      "metadata_params": ["action", "project_id", "issue_iid", "merge_request_iid", "note_id", "discussion_id", "award_id", "file_path", "key", "hook_id"],
      "operations": {
        "delete_issue": "deleteApiV4ProjectsIdIssuesIssueIid",
        "delete_merge_request": "deleteApiV4ProjectsIdMergeRequestsMergeRequestIid",
        "delete_issue_note": "deleteApiV4ProjectsIdIssuesIssueIidNotesNoteId",
        "delete_merge_request_note": "deleteApiV4ProjectsIdMergeRequestsMergeRequestIidNotesNoteId",
        "delete_issue_discussion": "deleteApiV4ProjectsIdIssuesIssueIidDiscussionsDiscussionId",
        "delete_issue_note_award_emoji": "deleteApiV4ProjectsIdIssuesIssueIidNotesNoteIdAwardEmojiAwardId",
        "delete_file": "deleteApiV4ProjectsIdRepositoryFilesFilePath",
        "delete_project_variable": "deleteApiV4ProjectsIdVariablesKey",
        "delete_project_hook": "deleteApiV4ProjectsIdHooksHookId"
      },
      "parameters": {
        "action": {
          "type": "string",
          "enum": ["delete_issue", "delete_merge_request", "delete_issue_note", "delete_merge_request_note", "delete_issue_discussion", "delete_issue_note_award_emoji", "delete_file", "delete_project_variable", "delete_project_hook"],
          "description": "Action to perform",
          "required": true
        },
        "project_id": {
          "type": "string",
          "description": "Project ID. Use numeric ID (e.g. '123') or URL-encoded path (e.g. 'group%2Fproject').",
          "required": true,
          "example": "123"
        },
        "issue_iid": {
          "type": "integer",
          "description": "The internal ID of the issue",
          "required_for": ["delete_issue", "delete_issue_note"]
        },
        "merge_request_iid": {
          "type": "integer",
          "description": "The internal ID of the merge request",
          "required_for": ["delete_merge_request", "delete_merge_request_note"]
        },
        "note_id": {
          "type": "integer",
          "description": "The ID of the note",
          "required_for": ["delete_issue_note", "delete_merge_request_note", "delete_issue_note_award_emoji"]
        },
        "discussion_id": {
          "type": "string",
          "description": "The ID of the discussion",
          "required_for": ["delete_issue_discussion"]
        },
        "award_id": {
          "type": "integer",
          "description": "The ID of the award emoji",
          "required_for": ["delete_issue_note_award_emoji"]
        },
        "file_path": {
          "type": "string",
          "description": "URL-encoded full path to the file, e.g., 'src%2Findex.js'. Use %2F instead of '/'.",
          "required_for": ["delete_file"]
        },
        "branch": {
          "type": "string",
          "description": "Branch name for file operations",
          "required_for": ["delete_file"]
        },
        "commit_message": {
          "type": "string",
          "description": "Commit message",
          "required_for": ["delete_file"]
        },
        "key": {
          "type": "string",
          "description": "Project variable key",
          "required_for": ["delete_project_variable"]
        },
        "hook_id": {
          "type": "integer",
          "description": "Hook ID",
          "required_for": ["delete_project_hook"]
        }
      }
    },

    {
      "name": "run_glql",
      "description": "Execute a GLQL query. Actions: 'query'.",
      "metadata_params": ["action"],
      "operations": {
        "query": "postApiV4Glql"
      },
      "parameters": {
        "action": {
          "type": "string",
          "enum": ["query"],
          "description": "Action to perform",
          "required": true
        },
        "glql_yaml": {
          "type": "string",
          "description": "GLQL YAML payload. Example:\nfields: id,title,author\ngroup: my-group\nlimit: 10\nsort: created desc\nquery: state = opened\nDocs: https://docs.gitlab.com/api/glql/",
          "required_for": ["query"],
          "example": "fields: id,title,author\ngroup: my-group\nlimit: 10\nsort: created desc\nquery: state = opened"
        }
      }
    }
  ],

  "interceptors": {
    "array_format": "brackets",
    "auth": [
      {
        "type": "oauth",
        "priority": 0,
        "validation_endpoint": "user",
        "oauth_config": {
          "issuer": "${env:GITLAB_OAUTH_ISSUER}",
          "client_id": "${env:GITLAB_OAUTH_CLIENT_ID}",
          "client_secret": "${env:GITLAB_OAUTH_CLIENT_SECRET}",
          "scopes": ["api", "read_repository"],
          "redirect_uri": "${env:GITLAB_OAUTH_REDIRECT_URI}"
        }
      },
      {
        "type": "bearer",
        "priority": 1,
        "value_from_env": "GITLAB_TOKEN",
        "validation_endpoint": "personal_access_tokens/self"
      }
    ],
    "base_url": {
      "value_from_env": "GITLAB_API_BASE_URL",
      "default": "https://gitlab.com/api/v4"
    },
    "rate_limit": {
      "max_requests_per_minute": 600,
      "overrides": {
        "postApiV4ProjectsIdIssues": {
          "max_requests_per_minute": 10
        },
        "deleteApiV4ProjectsIdIssuesIssueIid": {
          "max_requests_per_minute": 5
        },
        "postApiV4ProjectsIdMergeRequests": {
          "max_requests_per_minute": 10
        },
        "deleteApiV4ProjectsIdMergeRequestsMergeRequestIid": {
          "max_requests_per_minute": 5
        },
        "postApiV4ProjectsIdMergeRequestsMergeRequestIidNotes": {
          "max_requests_per_minute": 30
        },
        "putApiV4ProjectsIdMergeRequestsMergeRequestIidNotesNoteId": {
          "max_requests_per_minute": 30
        },
        "deleteApiV4ProjectsIdMergeRequestsMergeRequestIidNotesNoteId": {
          "max_requests_per_minute": 10
        }
      }
    },
    "retry": {
      "max_attempts": 3,
      "backoff_ms": [1000, 2000, 4000],
      "retry_on_status": [429, 500, 502, 503, 504]
    }
  }
}
