{
"type": "object",
"properties": {
"source_branch": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Branch ID."
},
"name": {
"type": "string",
"description": "Branch name, unique in the project."
},
"project_id": {
"type": "string",
"format": "uuid",
"description": "Project that owns the branch."
},
"base_branch_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null",
"description": "The base branch id returned by the tool."
}
],
"description": "Branch this branch was created from, or null for the root branch."
},
"status": {
"type": "string",
"enum": [
"active",
"merged",
"closed"
],
"description": "Lifecycle state; closed is distinct from merged."
},
"description": {
"type": [
"string",
"null"
],
"description": "Branch description, or null."
},
"auto_delete_on_merge": {
"type": "boolean",
"description": "Whether the branch is deleted after it merges."
},
"version": {
"type": "integer",
"minimum": 0,
"description": "Version to pass as expected_version when merging."
},
"created_at": {
"type": "string",
"description": "Creation time."
},
"created_by": {
"anyOf": [
{
"$ref": "#/properties/source_branch/properties/base_branch_id/anyOf/0",
"description": "The created by returned by the tool."
},
{
"type": "null",
"description": "The created by returned by the tool."
}
],
"description": "User who created the branch, or null."
},
"updated_at": {
"type": [
"string",
"null"
],
"description": "Last update time, or null."
},
"merged_at": {
"type": [
"string",
"null"
],
"description": "Merge time, or null before a merge."
},
"merged_by": {
"anyOf": [
{
"$ref": "#/properties/source_branch/properties/base_branch_id/anyOf/0",
"description": "The merged by returned by the tool."
},
{
"type": "null",
"description": "The merged by returned by the tool."
}
],
"description": "User who merged the branch, or null."
}
},
"required": [
"id",
"name",
"project_id",
"base_branch_id",
"status",
"description",
"auto_delete_on_merge",
"version",
"created_at",
"created_by",
"updated_at",
"merged_at",
"merged_by"
],
"additionalProperties": false,
"description": "Branch to merge."
},
"target_branch_id": {
"anyOf": [
{
"$ref": "#/properties/source_branch/properties/base_branch_id/anyOf/0",
"description": "The target branch id returned by the tool."
},
{
"type": "null",
"description": "The target branch id returned by the tool."
}
],
"description": "Branch that receives the merge, or null for main."
},
"target_branch_name": {
"type": "string",
"description": "Name of the branch that receives the merge."
},
"can_merge": {
"type": "boolean",
"description": "True only when blocked_reason is null, merge policies pass and no file has conflicts. Advisory: the merge checks these conditions again."
},
"blocked_reason": {
"type": [
"string",
"null"
],
"description": "Precondition that blocks the merge, such as a merged or closed branch, or a target that is the source branch or is closed; null when none does. A target that is missing or in another project is a not found error."
},
"has_conflicts": {
"type": "boolean",
"description": "Whether at least one file has conflicts."
},
"diffs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "File path; the file ID when neither side has a path."
},
"file_type": {
"type": "string",
"description": "File type."
},
"file_id": {
"type": [
"string",
"null"
],
"description": "File ID, or null."
},
"has_conflicts": {
"type": "boolean",
"description": "Whether the file has conflicts that block an automatic merge."
},
"conflict_count": {
"type": "integer",
"minimum": 0,
"description": "Number of conflict regions."
},
"conflict_regions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Region ID, stable within one preview; conflict resolutions are keyed by it."
},
"type": {
"type": "string",
"const": "conflict",
"description": "Region kind."
},
"base_start": {
"type": "integer",
"description": "First line in the common base."
},
"base_end": {
"type": "integer",
"description": "Last line in the common base."
},
"target_start": {
"type": "integer",
"description": "First line in the target branch."
},
"target_end": {
"type": "integer",
"description": "Last line in the target branch."
},
"source_start": {
"type": "integer",
"description": "First line in the source branch."
},
"source_end": {
"type": "integer",
"description": "Last line in the source branch."
},
"base_lines": {
"type": "string",
"description": "Conflicting text in the common base."
},
"target_lines": {
"type": "string",
"description": "Conflicting text in the target branch."
},
"source_lines": {
"type": "string",
"description": "Conflicting text in the source branch."
}
},
"required": [
"id",
"type",
"base_start",
"base_end",
"target_start",
"target_end",
"source_start",
"source_end",
"base_lines",
"target_lines",
"source_lines"
],
"additionalProperties": false
},
"description": "Conflicting line ranges."
},
"is_new": {
"type": "boolean",
"description": "The merge adds the file to the target."
},
"is_deleted": {
"type": "boolean",
"description": "The merge deletes the file from the target."
},
"is_modified": {
"type": "boolean",
"description": "The merge changes the file in the target."
},
"base_changed": {
"type": "boolean",
"description": "The target changed the file since the branch was created."
},
"branch_changed": {
"type": "boolean",
"description": "The branch changed the file."
},
"base_content": {
"type": [
"string",
"null"
],
"description": "Content at the common base, or null."
},
"target_content": {
"type": [
"string",
"null"
],
"description": "Content in the target branch, or null."
},
"source_content": {
"type": [
"string",
"null"
],
"description": "Content in the source branch, or null."
}
},
"required": [
"file_path",
"file_type",
"file_id",
"has_conflicts",
"conflict_count",
"conflict_regions",
"is_new",
"is_deleted",
"is_modified",
"base_changed",
"branch_changed",
"base_content",
"target_content",
"source_content"
],
"additionalProperties": false
},
"description": "File-by-file changes the merge applies."
}
},
"required": [
"source_branch",
"target_branch_id",
"target_branch_name",
"can_merge",
"blocked_reason",
"has_conflicts",
"diffs"
],
"additionalProperties": false,
"description": "Structured result returned by the get_branch_merge_preview tool.",
"$schema": "http://json-schema.org/draft-07/schema#"
}