# This file is automatically generated by ravepipeline::mcptool_build(). 
# Please never edit this file by hand!
name: ieegio-mcp_tool_surface_clear
description: Remove one or all surfaces from the session cache. This frees up memory
  occupied by cached surface objects. If an ID is provided, only that specific surface
  is removed. If no ID is provided (empty string), all cached surfaces are cleared.
parameters:
  type: object
  properties:
    id:
      type: string
      description: 'The digest-based identifier of the surface to remove. Empty string
        (default) clears all surfaces. Example values: "a3f5e8d9c1b2", "f7e4b2a1c6d8",
        ""'
      default: ''
      examples:
      - a3f5e8d9c1b2
      - f7e4b2a1c6d8
category: execution
returns:
  type: object
  properties:
    error:
      type: string
      description: Character, error message if success is FALSE
    cleared_ids:
      type: array
      description: Character vector, IDs of surfaces that were removed
      items:
        type: string
    message:
      type: string
      description: Character, human-readable status message
    success:
      type: boolean
      description: Logical, whether the operation completed successfully
implementation_example: |
  # Clear specific surface from cache
  # Note: .state_env is automatically provided when called via MCP.
  # AI does not need to specify this argument. The examples only use
  # .state_env to make the code runnable for demonstration purposes.
  state_env <- fastmap::fastmap()
  sample_file <- ieegio_sample_data("gifti/GzipBase64/sujet01_Lwhite.surf.gii")
  read_result <- ieegio:::mcp_tool_surface_read(sample_file, .state_env = state_env)
  # Clear the specific surface
  ieegio:::mcp_tool_surface_clear(
    id = read_result$id,
    .state_env = state_env
  )
  #
  #> $success
  #> [1] TRUE
  #> 
  #> $message
  #> [1] "Cleared 1 surface from cache"
  #> 
  #> $cleared_ids
  #> [1] "87405ad0bc7df5262dadebee27bf4c3b"
  #>
execution_time: 0.016
