Skip to main content
Glama
ibm-ecm

Core Content Services MCP Server

Official
by ibm-ecm

checkout_document

Check out a document from the repository, optionally update its properties and download its content to a folder.

Instructions

Checks out a document in the content repository.

:param identifier: The document id or path (required). This can be either the document's ID (GUID) or its path in the repository (e.g., "/Folder1/document.pdf"). :param document_properties: Properties to update for the document during check-out. :param checkout_action: Check-out action parameters for the document. :param download_folder_path: Optional path to a folder where the document content will be downloaded. If not provided but content download is needed, the user will be prompted to provide it.

:returns: If successful, returns a Document object with its updated properties. If unsuccessful, returns a ToolError with details about the failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYes
document_propertiesNo
checkout_actionNo
download_folder_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'checkout_document' tool. It executes a GraphQL checkoutDocument mutation, processes optional document properties and checkout action, downloads content to a folder if requested, and returns a Document object or ToolError.
    @mcp.tool(
        name="checkout_document",
    )
    async def checkout_document(
        identifier: str,
        document_properties: Optional[DocumentPropertiesInput] = None,
        checkout_action: Optional[SubCheckoutActionInput] = None,
        download_folder_path: Optional[str] = None,
    ) -> Union[Document, ToolError]:
        """
        Checks out a document in the content repository.
    
        :param identifier: The document id or path (required). This can be either the document's ID (GUID) or its path in the repository (e.g., "/Folder1/document.pdf").
        :param document_properties: Properties to update for the document during check-out.
        :param checkout_action: Check-out action parameters for the document.
        :param download_folder_path: Optional path to a folder where the document content will be downloaded.
                                    If not provided but content download is needed, the user will be prompted to provide it.
    
        :returns: If successful, returns a Document object with its updated properties.
                 If unsuccessful, returns a ToolError with details about the failure.
        """
        method_name = "checkout_document"
        try:
            # Prepare the mutation
            mutation = """
            mutation ($object_store_name: String!, $identifier: String!,
                     $document_properties: DocumentPropertiesInput, $checkout_action: SubCheckoutActionInput) {
              checkoutDocument(
                repositoryIdentifier: $object_store_name
                identifier: $identifier
                documentProperties: $document_properties
                checkoutAction: $checkout_action
              ) {
                id
                className
                reservation{
                    isReserved
                    id
                }
                currentVersion{
                    contentElements{
                        ... on ContentTransferType {
                            retrievalName
                            contentType
                            contentSize
                            downloadUrl
                        }
                    }
                }
                properties {
                  id
                  value
                }
              }
            }
            """
    
            # Prepare variables for the GraphQL query
            variables = {
                "object_store_name": graphql_client.object_store,
                "identifier": identifier,
                "document_properties": None,
                "checkout_action": None,
            }
    
            # Process document properties if provided
            if document_properties:
                try:
                    document_properties.eval()
                    transformed_props = document_properties.transform_properties_dict(
                        exclude_none=True
                    )
                    variables["document_properties"] = transformed_props
                except Exception as e:
                    logger.error("Error transforming document properties: %s", str(e))
                    logger.error(traceback.format_exc())
                    return ToolError(
                        message=f"{method_name} failed: {str(e)}. Trace available in server logs."
                    )
    
            # Handle checkout action if provided
            if checkout_action:
                # Use model_dump with exclude_none for cleaner code
                variables["checkout_action"] = checkout_action.model_dump(
                    exclude_none=True
                )
    
            # Execute the GraphQL mutation
            logger.info("Executing document check-out")
            response: Union[ToolError, Dict[str, Any]] = (
                await graphql_client_execute_async_wrapper(
                    logger,
                    method_name,
                    graphql_client,
                    query=mutation,
                    variables=variables,
                )
            )
            if isinstance(response, ToolError):
                return response
    
            # Create a Document instance from the response
            document = Document.create_an_instance(
                graphQL_changed_object_dict=response["data"]["checkoutDocument"],
                class_identifier=DEFAULT_DOCUMENT_CLASS,
            )
    
            # Check if we need to download content
            if (
                download_folder_path
                and "currentVersion" in response["data"]["checkoutDocument"]
            ):
                content_elements = response["data"]["checkoutDocument"][
                    "currentVersion"
                ]["contentElements"]
    
                if content_elements and len(content_elements) > 0:
                    logger.info(
                        "Found %s content elements to download", len(content_elements)
                    )
    
                    download_results = []
                    download_errors = []
    
                    for idx, element in enumerate(content_elements):
                        if "downloadUrl" in element and element["downloadUrl"]:
                            download_url = element["downloadUrl"]
                            logger.info(
                                "Downloading content element %s/%s: %s",
                                idx + 1,
                                len(content_elements),
                                element["retrievalName"],
                            )
    
                            download_result = (
                                await graphql_client.download_content_async(
                                    download_url=download_url,
                                    download_folder_path=download_folder_path,
                                )
                            )
    
                            if download_result["success"]:
                                download_results.append(download_result)
                                logger.info(
                                    "Content element %s downloaded to %s",
                                    idx + 1,
                                    download_result["file_path"],
                                )
                            else:
                                error_msg = (
                                    "Failed to download content element %s: %s"
                                    % (
                                        idx + 1,
                                        download_result["error"],
                                    )
                                )
                                download_errors.append(error_msg)
                                logger.warning(error_msg)
    
                    if download_errors:
                        error_message = (
                            "Document checkout was successful, but %s content downloads failed: %s"
                            % (len(download_errors), "; ".join(download_errors))
                        )
                        logger.warning(error_message)
                        return ToolError(
                            message=error_message,
                            suggestions=[
                                "Check if the download folder exists and is writable",
                                "Verify network connectivity to the content server",
                                "Try downloading the files without checking out the document",
                            ],
                        )
                    elif download_results:
                        logger.info(
                            "Successfully downloaded %s content elements",
                            len(download_results),
                        )
            return document
    
        except Exception as e:
            logger.error("%s failed: %s", method_name, str(e))
            logger.error(traceback.format_exc())
            return ToolError(
                message=f"{method_name} failed: {str(e)}. Trace available in server logs."
            )
  • The SubCheckoutActionInput schema used by checkout_document for defining checkout action parameters (reservationId, reservationType, reservationClass, reservationProperties, reservationObjectProperties).
    class SubCheckoutActionInput(BaseModel):
        """Input for document check-out action."""
    
        reservationId: Optional[str] = Field(
            default=None, description="ID for the reservation"
        )
        reservationType: Optional[ReservationType] = Field(
            default=None,
            description="Type of reservation (COLLABORATIVE, EXCLUSIVE, or OBJECT_STORE_DEFAULT)",
        )
        reservationClass: Optional[str] = Field(
            default=None, description="Class for the reservation"
        )
        reservationProperties: Optional[List[PropertyIdentifierAndScalarValue]] = Field(
            default=None, description="Properties for the reservation"
        )
        reservationObjectProperties: Optional[List[ObjectPropertyInput]] = Field(
            default=None, description="Object properties for the reservation"
        )
  • The DocumentPropertiesInput schema used by checkout_document for defining document properties during checkout.
    class DocumentPropertiesInput(CustomInputBase):
        """Input for document properties."""
    
        properties: Optional[List[PropertyIdentifierAndScalarValue]] = Field(
            default=None, description="Properties for Document"
        )
        name: Optional[str] = Field(
            default=None,
            description="Name sets DocumentTitle or whatever property is configured as the Name property",
        )
        owner: Optional[str] = Field(default=None, description="Owner")
        content: Optional[str] = Field(
            default=None,
            description="Content can be specified if this represents a Reservation document or document creation",
        )
        mimeType: Optional[str] = Field(default=None, description="Mime type")
        compoundDocumentState: Optional[str] = Field(
            default=None, description="Compound document state"
        )
        cmRetentionDate: Optional[datetime] = Field(
            default=None, description="Retention date"
        )
        # contentElements field removed from the model to prevent agents from interpreting and creating this field
        # Instead, we use the methods from CustomInputBase to add content elements programmatically
    
        # Commented out references to ObjectReferenceInput, PermissionListInput, ObjectPropertyInput
        """
        objectProperties: Optional[List[ObjectPropertyInput]] = Field(
            default=None, description="Object properties"
        )
        replicationGroup: Optional[ObjectReferenceInput] = Field(
            default=None, description="Replication group"
        )
        permissions: Optional[PermissionListInput] = Field(
            default=None, description="Permissions"
        )
        securityPolicy: Optional[ObjectReferenceInput] = Field(
            default=None, description="Security policy"
        )
        securityFolder: Optional[ObjectReferenceInput] = Field(
            default=None, description="Security folder"
        )
        storagePolicy: Optional[ObjectReferenceInput] = Field(
            default=None, description="Storage policy"
        )
        documentLifecyclePolicy: Optional[ObjectReferenceInput] = Field(
            default=None, description="Document lifecycle policy"
        )
        storageArea: Optional[ObjectReferenceInput] = Field(
            default=None, description="Storage area"
        )
        """
  • The register_document_tools function that registers the checkout_document tool (and other document tools) via the @mcp.tool decorator.
    def register_document_tools(
        mcp: FastMCP, graphql_client: GraphQLClient, metadata_cache: MetadataCache
    ) -> None:
  • The graphql_client_execute_async_wrapper helper function used by checkout_document for executing GraphQL queries with error handling, timing, and logging.
    async def graphql_client_execute_async_wrapper (
        logger: Logger,
        method_name: str,
        graphql_client: GraphQLClient, 
        query: str, variables: Optional[Dict[str, Any]] = None
        ) -> Union [ToolError, Dict[str, Any]]:
        "Wrapper for graphql_client.execute_async to handle errors, timing and logging of GraphQL queries."
        
        start_time = time.perf_counter()
        response = None
        try:
            logger.debug(f"{method_name}, GraphQL query: {query}, GraphQL variables: {variables} ") 
            response = await graphql_client.execute_async(query=query, variables=variables)
            if "errors" in response:
                error_message = response["errors"]
                logger.error(f"{method_name} failed: {error_message}")
                return ToolError(   message=f"{method_name} failed: got err {error_message}. Trace available in server logs.", )    
    
            if "error" in response:
                error_type = response.get("error_type", "")  # Get error_type if it exists, otherwise empty string               
                error_message = f"error_type = {error_type}, message = {response["message"]}"
                logger.error(f"{method_name} failed: {error_message}")
                return ToolError(   message=f"{method_name} failed: got err {error_message}. Trace available in server logs.", )    
    
            if "data" not in response or response["data"] is None:
                error_message = f" No 'data' returned from GraphQL query"
                logger.error(f"{method_name} failed: {error_message}")
                return ToolError(   message=f"{method_name} failed: got err {error_message}. Trace available in server logs.", )    
    
            return response 
        except Exception as ex:
            error_traceback = traceback.format_exc(limit=TRACEBACK_LIMIT)
            logger.error(
                    f"{method_name} failed: {ex.__class__.__name__} - {str(ex)}\n{error_traceback}"
                )
    
            return ToolError(
                    message=f"{method_name} failed: got err {ex}. Trace available in server logs.",
                )
        finally:
            logger.debug(f"{method_name}, GraphQL response (elapse {time.perf_counter() - start_time:.2f}s): {response}") 

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv1.0.4
    • removedInput schema / $defs
      Removed value: -{
      -  "DocumentPropertiesInput": {
      -    "description": "Input for document properties.",
      -    "properties": {
      -      "cmRetentionDate": {
      -        "anyOf": [
      -          {
      -            "format": "date-time",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Retention date",
      -        "title": "Cmretentiondate"
      -      },
      -      "compoundDocumentState": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Compound document state",
      -        "title": "Compounddocumentstate"
      -      },
      -      "content": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Content can be specified if this represents a Reservation document or document creation",
      -        "title": "Content"
      -      },
      -      "mimeType": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Mime type",
      -        "title": "Mimetype"
      -      },
      -      "name": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Name sets DocumentTitle or whatever property is configured as the Name property",
      -        "title": "Name"
      -      },
      -      "owner": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Owner",
      -        "title": "Owner"
      -      },
      -      "properties": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "$ref": "#/$defs/PropertyIdentifierAndScalarValue"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Properties for Document",
      -        "title": "Properties"
      -      }
      -    },
      -    "title": "DocumentPropertiesInput",
      -    "type": "object"
      -  },
      -  "ObjectPropertyInput": {
      -    "description": "Object property input.",
      -    "properties": {},
      -    "title": "ObjectPropertyInput",
      -    "type": "object"
      -  },
      -  "PropertyIdentifierAndScalarValue": {
      -    "description": "Represents a property with an identifier and scalar value.",
      -    "properties": {
      -      "identifier": {
      -        "description": "Property identifier",
      -        "title": "Identifier",
      -        "type": "string"
      -      },
      -      "value": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "boolean"
      -          },
      -          {},
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Property value",
      -        "title": "Value"
      -      }
      -    },
      -    "required": [
      -      "identifier"
      -    ],
      -    "title": "PropertyIdentifierAndScalarValue",
      -    "type": "object"
      -  },
      -  "ReservationType": {
      -    "description": "Specifies the type of reservation created for a checked-out document.",
      -    "enum": [
      -      "COLLABORATIVE",
      -      "EXCLUSIVE",
      -      "OBJECT_STORE_DEFAULT"
      -    ],
      -    "title": "ReservationType",
      -    "type": "string"
      -  },
      -  "SubCheckoutActionInput": {
      -    "description": "Input for document check-out action.",
      -    "properties": {
      -      "reservationClass": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Class for the reservation",
      -        "title": "Reservationclass"
      -      },
      -      "reservationId": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "ID for the reservation",
      -        "title": "Reservationid"
      -      },
      -      "reservationObjectProperties": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "$ref": "#/$defs/ObjectPropertyInput"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Object properties for the reservation",
      -        "title": "Reservationobjectproperties"
      -      },
      -      "reservationProperties": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "$ref": "#/$defs/PropertyIdentifierAndScalarValue"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Properties for the reservation",
      -        "title": "Reservationproperties"
      -      },
      -      "reservationType": {
      -        "anyOf": [
      -          {
      -            "$ref": "#/$defs/ReservationType"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Type of reservation (COLLABORATIVE, EXCLUSIVE, or OBJECT_STORE_DEFAULT)"
      -      }
      -    },
      -    "title": "SubCheckoutActionInput",
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / checkout_action / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/$defs/SubCheckoutActionInput"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "Input for document check-out action.",
      +    "properties": {
      +      "reservationClass": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Class for the reservation"
      +      },
      +      "reservationId": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "ID for the reservation"
      +      },
      +      "reservationObjectProperties": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "description": "Object property input.",
      +              "properties": {},
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Object properties for the reservation"
      +      },
      +      "reservationProperties": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "description": "Represents a property with an identifier and scalar value.",
      +              "properties": {
      +                "identifier": {
      +                  "description": "Property identifier",
      +                  "type": "string"
      +                },
      +                "value": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "integer"
      +                    },
      +                    {
      +                      "type": "number"
      +                    },
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {},
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "Property value"
      +                }
      +              },
      +              "required": [
      +                "identifier"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Properties for the reservation"
      +      },
      +      "reservationType": {
      +        "anyOf": [
      +          {
      +            "description": "Specifies the type of reservation created for a checked-out document.",
      +            "enum": [
      +              "COLLABORATIVE",
      +              "EXCLUSIVE",
      +              "OBJECT_STORE_DEFAULT"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Type of reservation (COLLABORATIVE, EXCLUSIVE, or OBJECT_STORE_DEFAULT)"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / document_properties / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/$defs/DocumentPropertiesInput"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "Input for document properties.",
      +    "properties": {
      +      "cmRetentionDate": {
      +        "anyOf": [
      +          {
      +            "format": "date-time",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Retention date"
      +      },
      +      "compoundDocumentState": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Compound document state"
      +      },
      +      "content": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Content can be specified if this represents a Reservation document or document creation"
      +      },
      +      "mimeType": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Mime type"
      +      },
      +      "name": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Name sets DocumentTitle or whatever property is configured as the Name property"
      +      },
      +      "owner": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Owner"
      +      },
      +      "properties": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "description": "Represents a property with an identifier and scalar value.",
      +              "properties": {
      +                "identifier": {
      +                  "description": "Property identifier",
      +                  "type": "string"
      +                },
      +                "value": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "integer"
      +                    },
      +                    {
      +                      "type": "number"
      +                    },
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {},
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "default": null,
      +                  "description": "Property value"
      +                }
      +              },
      +              "required": [
      +                "identifier"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Properties for Document"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / download_folder_path / title
      Removed value: -"Download Folder Path"
    • removedInput schema / properties / identifier / title
      Removed value: -"Identifier"
    • removedInput schema / title
      Removed value: -"checkout_documentArguments"
    • removedOutput schema / $defs
      Removed value: -{
      -  "Document": {
      -    "description": "Document class for the MCP server.",
      -    "properties": {
      -      "className": {
      -        "default": "Document",
      -        "description": "Class identifier for the document",
      -        "title": "Classname",
      -        "type": "string"
      -      },
      -      "contentSize": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Size of the document content",
      -        "title": "Contentsize"
      -      },
      -      "creator": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The creator of the document",
      -        "title": "Creator"
      -      },
      -      "dateCreated": {
      -        "anyOf": [
      -          {
      -            "format": "date-time",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Date when document was created",
      -        "title": "Datecreated"
      -      },
      -      "dateLastModified": {
      -        "anyOf": [
      -          {
      -            "format": "date-time",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Date when document was last modified",
      -        "title": "Datelastmodified"
      -      },
      -      "id": {
      -        "description": "The id of the document",
      -        "title": "Id",
      -        "type": "string"
      -      },
      -      "isVersioningEnabled": {
      -        "anyOf": [
      -          {
      -            "type": "boolean"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Whether versioning is enabled",
      -        "title": "Isversioningenabled"
      -      },
      -      "lastModifier": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The last modifier of the document",
      -        "title": "Lastmodifier"
      -      },
      -      "majorVersionNumber": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Major version number",
      -        "title": "Majorversionnumber"
      -      },
      -      "mimeType": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "MIME type of the document",
      -        "title": "Mimetype"
      -      },
      -      "minorVersionNumber": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Minor version number",
      -        "title": "Minorversionnumber"
      -      },
      -      "name": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The name of the document",
      -        "title": "Name"
      -      },
      -      "owner": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "The owner of the document",
      -        "title": "Owner"
      -      },
      -      "properties": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "additionalProperties": true,
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Document properties",
      -        "title": "Properties"
      -      }
      -    },
      -    "required": [
      -      "id"
      -    ],
      -    "title": "Document",
      -    "type": "object"
      -  },
      -  "ToolError": {
      -    "description": "Represents an error response from a tool execution.\n\nThis class helps the LLM understand error messages and provides suggestions\nfor potential resolutions.",
      -    "properties": {
      -      "isError": {
      -        "const": true,
      -        "default": true,
      -        "description": "Indicates that an error occurred during tool execution if value is True",
      -        "title": "Iserror",
      -        "type": "boolean"
      -      },
      -      "message": {
      -        "description": "Detailed error message",
      -        "title": "Message",
      -        "type": "string"
      -      },
      -      "suggestions": {
      -        "description": "List of suggestions for resolving the error",
      -        "items": {
      -          "type": "string"
      -        },
      -        "title": "Suggestions",
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "message"
      -    ],
      -    "title": "ToolError",
      -    "type": "object"
      -  }
      -}
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/$defs/Document"
      -  },
      -  {
      -    "$ref": "#/$defs/ToolError"
      -  }
      -]New value: +[
      +  {
      +    "description": "Document class for the MCP server.",
      +    "properties": {
      +      "className": {
      +        "default": "Document",
      +        "description": "Class identifier for the document",
      +        "type": "string"
      +      },
      +      "contentSize": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Size of the document content"
      +      },
      +      "creator": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The creator of the document"
      +      },
      +      "dateCreated": {
      +        "anyOf": [
      +          {
      +            "format": "date-time",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Date when document was created"
      +      },
      +      "dateLastModified": {
      +        "anyOf": [
      +          {
      +            "format": "date-time",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Date when document was last modified"
      +      },
      +      "id": {
      +        "description": "The id of the document",
      +        "type": "string"
      +      },
      +      "isVersioningEnabled": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Whether versioning is enabled"
      +      },
      +      "lastModifier": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The last modifier of the document"
      +      },
      +      "majorVersionNumber": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Major version number"
      +      },
      +      "mimeType": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "MIME type of the document"
      +      },
      +      "minorVersionNumber": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Minor version number"
      +      },
      +      "name": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The name of the document"
      +      },
      +      "owner": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The owner of the document"
      +      },
      +      "properties": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "additionalProperties": true,
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Document properties"
      +      }
      +    },
      +    "required": [
      +      "id"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "Represents an error response from a tool execution.\n\nThis class helps the LLM understand error messages and provides suggestions\nfor potential resolutions.",
      +    "properties": {
      +      "isError": {
      +        "const": true,
      +        "default": true,
      +        "description": "Indicates that an error occurred during tool execution if value is True",
      +        "type": "boolean"
      +      },
      +      "message": {
      +        "description": "Detailed error message",
      +        "type": "string"
      +      },
      +      "suggestions": {
      +        "description": "List of suggestions for resolving the error",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "message"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"checkout_documentOutput"
    • addedOutput schema / x-fastmcp-wrap-result
      Added value: +true
  2. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description partially discloses behavior: it mentions document property updates, optional download, and failure returns a ToolError. However, it does not clarify locking, permission requirements, or side effects, which are important for a checkout action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured with a docstring format. It front-loads the main purpose and then lists parameters. Minor redundancy with return info, but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and the presence of an output schema, the description covers the essential aspects: input parameters, return type (Document or ToolError), and a key behavioral note about download folder prompting. It is adequate for a checkout operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema. It explains that 'identifier' can be an ID or path (e.g., '/Folder1/document.pdf'), and that 'download_folder_path' is optional and may prompt the user. Schema coverage is 0%, so the description fully compensates with clear parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Checks out a document in the content repository' which is a clear verb-resource pair. It distinguishes from sibling tools like cancel_document_checkout and checkin_document by explicitly focusing on the check-out action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidelines on when to use this tool versus alternatives. It lacks context on prerequisites or when not to use it, leaving the agent to infer from the tool name and sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.