Class: LinearToonMcp::Tools::ArchiveProject

Inherits:
Base
  • Object
show all
Defined in:
lib/linear_toon_mcp/tools/archive_project.rb

Overview

Archive a Linear project by name or UUID. Linear’s project archive is recoverable (matches the Linear UI’s archive behaviour); there’s no hard-delete equivalent and we intentionally don’t expose one.

Constant Summary collapse

MUTATION =
<<~GRAPHQL
  mutation($id: String!) {
    projectArchive(id: $id) { success entity { id name archivedAt } }
  }
GRAPHQL

Instance Method Summary collapse

Methods inherited from Base

call, #call, error_response, success_response

Instance Method Details

#perform(project:) ⇒ Object

Raises:



32
33
34
35
36
37
38
# File 'lib/linear_toon_mcp/tools/archive_project.rb', line 32

def perform(project:)
  project_id = Resolvers::Project.call(value: project)
  data = client.query(MUTATION, variables: {id: project_id})
  result = data["projectArchive"] or raise Error, "Project archive failed: no result returned"
  raise Error, "Project archive failed" unless result["success"]
  result["entity"]
end