{
  "package": {
    "name": "@teamgrid/mcp-server",
    "sourceCommit": "b0e4b3dfa4afd74822a73b8b5e8b647236f273ce",
    "sourceRepository": "TeamGrid/developer-platform",
    "version": "1.2.2"
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": true,
    "openWorldHint": false
  },
  "contract": {
    "domain": "catalog-write",
    "concurrency": "conditional",
    "idempotency": false,
    "coreCas": false
  },
  "outputSchema": {
    "type": "object",
    "properties": {
      "data": {
        "$ref": "#/$defs/CustomFieldValueMutation"
      },
      "meta": {
        "additionalProperties": false,
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Unique identifier assigned to the API request for tracing and support."
          },
          "privateResource": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "uri",
              "maxBytes",
              "readMethod"
            ],
            "properties": {
              "uri": {
                "type": "string",
                "pattern": "^teamgrid://(?:files|exports)/[A-Za-z0-9_.:%-]+$"
              },
              "maxBytes": {
                "const": 1048576
              },
              "readMethod": {
                "const": "resources/read"
              }
            }
          },
          "etag": {
            "type": "string",
            "pattern": "^\"[\\x21\\x23-\\x7e]{1,256}\"$"
          },
          "resume": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "tool",
              "arguments"
            ],
            "properties": {
              "tool": {
                "enum": [
                  "teamgrid_project_lifecycle_operation_get",
                  "teamgrid_planned_work_operation_get",
                  "teamgrid_task_recurrence_operation_get",
                  "teamgrid_export_get"
                ]
              },
              "arguments": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              }
            }
          },
          "outcome": {
            "enum": [
              "completed",
              "accepted",
              "partial",
              "unknown",
              "failed"
            ]
          },
          "omittedFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contentReadTool": {
            "const": "teamgrid_document_get"
          },
          "contentPage": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "unit": {
                "const": "utf16"
              },
              "offset": {
                "type": "integer",
                "minimum": 0
              },
              "nextOffset": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "totalLength": {
                "type": "integer",
                "minimum": 0
              },
              "complete": {
                "type": "boolean"
              },
              "revision": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "unit",
              "offset",
              "nextOffset",
              "totalLength",
              "complete",
              "revision"
            ]
          },
          "search": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "complete": {
                "const": false
              },
              "indexed": {
                "const": true
              },
              "returned": {
                "type": "integer",
                "minimum": 0
              },
              "limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 50
              },
              "continuation": {
                "const": "narrow-query-or-list"
              },
              "verification": {
                "const": "read-by-id"
              }
            },
            "required": [
              "complete",
              "indexed",
              "returned",
              "limit",
              "continuation",
              "verification"
            ]
          }
        },
        "required": [
          "requestId"
        ],
        "type": "object",
        "description": "Public API representation of meta."
      }
    },
    "required": [
      "data",
      "meta"
    ],
    "additionalProperties": false,
    "$defs": {
      "CustomFieldValueMutation": {
        "additionalProperties": false,
        "properties": {
          "attributes": {
            "additionalProperties": false,
            "allOf": [
              {
                "else": {
                  "not": {
                    "properties": {
                      "value": {}
                    },
                    "required": [
                      "value"
                    ]
                  }
                },
                "if": {
                  "properties": {
                    "state": {
                      "const": "set"
                    }
                  },
                  "required": [
                    "state"
                  ]
                },
                "then": {
                  "properties": {
                    "value": {}
                  },
                  "required": [
                    "value"
                  ]
                }
              }
            ],
            "properties": {
              "fieldId": {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9]+$",
                "type": "string",
                "description": "Identifier of the custom-field definition."
              },
              "fieldType": {
                "enum": [
                  "contact",
                  "date",
                  "dropdown",
                  "number",
                  "project",
                  "switcher",
                  "tag",
                  "text",
                  "textarea",
                  "user"
                ],
                "type": "string",
                "description": "Canonical type used to validate and interpret the custom field."
              },
              "replayed": {
                "description": "Whether the mutation was an idempotent canonical no-op.",
                "readOnly": true,
                "type": "boolean"
              },
              "resourceId": {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9_-]+$",
                "type": "string",
                "description": "Identifier of the resource represented by this record."
              },
              "revision": {
                "pattern": "^cfv1-[a-f0-9]{64}$",
                "type": "string",
                "description": "Strong resource revision used for optimistic concurrency control."
              },
              "state": {
                "enum": [
                  "invalid",
                  "set",
                  "unset"
                ],
                "type": "string",
                "description": "Canonical lifecycle state of the resource or operation."
              },
              "targetType": {
                "enum": [
                  "contact",
                  "project",
                  "project-journal-entry",
                  "task"
                ],
                "type": "string",
                "description": "Canonical type of the target resource."
              },
              "value": {
                "description": "Canonical value represented by this field.",
                "$ref": "#/$defs/CustomFieldValueValue"
              }
            },
            "required": [
              "fieldId",
              "fieldType",
              "replayed",
              "resourceId",
              "revision",
              "state",
              "targetType"
            ],
            "type": "object",
            "description": "The attributes associated with this custom field value mutation."
          },
          "id": {
            "pattern": "^cfv_[a-f0-9]{64}$",
            "type": "string",
            "description": "Stable TeamGrid identifier for this resource."
          },
          "type": {
            "const": "customFieldValue",
            "type": "string",
            "description": "Canonical type discriminator for this resource."
          }
        },
        "required": [
          "attributes",
          "id",
          "type"
        ],
        "type": "object",
        "description": "Public API representation of custom field value mutation."
      },
      "CustomFieldValueValue": {
        "description": "Canonical value. The field definition selects the valid branch and applies tighter length, option, reference, and number constraints. Serialized input is limited to 256 KiB.",
        "oneOf": [
          {
            "type": "boolean"
          },
          {
            "minimum": 0,
            "type": "number"
          },
          {
            "maxLength": 100000,
            "type": "string"
          },
          {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          }
        ]
      }
    }
  },
  "profileOutputSchemas": {},
  "exposure": "gated-write",
  "apiOperations": [
    {
      "href": "/api/v1/reference/operations/setcustomfieldvalue/",
      "method": "PUT",
      "operationId": "setCustomFieldValue",
      "path": "/custom-field-values/{targetType}/{resourceId}/{fieldId}"
    }
  ],
  "availableIn": [
    "full",
    "catalog-write"
  ],
  "baseProfile": "full",
  "description": "Set a custom-field value. Changes the selected workspace under current API permissions. Read the target first; submit its exact ETag. On conflict, review the current state before making a new decision.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "workspaceId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "description": "Workspace returned by teamgrid_workspace_get and selected for this exact action."
      },
      "targetType": {
        "enum": [
          "contact",
          "project",
          "project-journal-entry",
          "task"
        ],
        "type": "string"
      },
      "resourceId": {
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "type": "string"
      },
      "fieldId": {
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9]+$",
        "type": "string"
      },
      "expectedRevision": {
        "pattern": "^\"cfv1-[a-f0-9]{64}\"$",
        "type": "string",
        "description": "Exact strong ETag (including quotes) from the read reviewed for this action. Never replace it automatically after a conflict."
      },
      "data": {
        "additionalProperties": false,
        "properties": {
          "value": {
            "description": "Canonical value represented by this field.",
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "maxLength": 100000,
                "type": "string"
              },
              {
                "items": {
                  "maxLength": 128,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              }
            ]
          }
        },
        "required": [
          "value"
        ],
        "type": "object",
        "description": "Public API representation of custom field value set."
      }
    },
    "required": [
      "workspaceId",
      "targetType",
      "resourceId",
      "fieldId",
      "expectedRevision",
      "data"
    ],
    "additionalProperties": false
  },
  "profileInputSchemas": {},
  "name": "teamgrid_custom_field_value_set",
  "scopes": {
    "optional": [],
    "conditional": [
      "contacts:read",
      "contacts:write",
      "projects:read",
      "projects:write",
      "project-statements:write",
      "tags:read",
      "tasks:write",
      "users:read"
    ],
    "required": [
      "custom-field-values:write",
      "workspace:read"
    ]
  },
  "security": {
    "classification": "workspace-mutation",
    "summary": "This changes workspace state and may trigger business or external effects. Use its exact scope, revision and idempotency contract; profile selection grants no authority."
  },
  "output": {
    "format": "A compact mutation receipt includes target and revision when available; outcome metadata distinguishes accepted, complete, partial and uncertain results.",
    "kind": "mutation-receipt",
    "maxSerializedBytes": 262144,
    "pagination": null,
    "redactions": [],
    "searchLimit": null
  },
  "examplePrompt": "Prepare a teamgrid_custom_field_value_set operation for my chosen target. Resolve IDs, read current state and revisions, show the intended change, then report its confirmed or uncertain outcome without automatic retries.",
  "typicalErrors": [
    {
      "condition": "The selected tool profile or allow/deny filter excludes `teamgrid_custom_field_value_set`.",
      "result": "The tool is not advertised to the host. Select the narrowest profile that contains it and restart the host."
    },
    {
      "condition": "An argument violates this tool’s input schema: required field, type, enum, pattern, length, or range.",
      "result": "MCP input validation rejects the call before an API request is made."
    },
    {
      "condition": "The credential lacks `custom-field-values:write` and `workspace:read` and an applicable conditional domain scope (`contacts:read`, `contacts:write`, `projects:read`, `projects:write`, `project-statements:write`, `tags:read`, `tasks:write`, `users:read`) or cannot access the requested resource.",
      "result": "The tool preserves a safe API error code such as `insufficient_scope`, with redacted detail and available status/request metadata."
    },
    {
      "condition": "The connection ends while awaiting the write result.",
      "result": "Inspect the outcome and status/resume information. An interrupted wait does not prove rollback; never blindly repeat the write."
    },
    {
      "condition": "An unknown input property is supplied.",
      "result": "The strict input schema rejects the call before an API request is made."
    }
  ]
}
