hack.foo
Reference

MCP fields and results

Exact tool inputs for v4.2.4. Start with Agent integrations for setup. These are MCP JSON input names, not CLI flag spellings.

Registration does not establish backend compatibility. A successful command result is not application health or readiness.

Input rules

Schema-optional selectors can still have conditional requirements. hack.project.init requires path or repoRoot. Do not provide conflicting selectors. service and services, compose and loki, profiles and runtime selection interact through the command handler. The schema does not promise every combination succeeds.

Run timeout defaults to 120000 ms. Init uses a 180000 ms child timeout and exposes no timeout input. Log tail collection defaults to 200 events and 5000 ms. These are handler fallbacks, not schema defaults. An omitted log tail can be forwarded to the CLI, which has its own default.

Numeric input declarations use z.number() in this version. Do not assume the later positive-integer ceilings or typed pre-spawn errors from v5.

hack.projects.list

source

InputPresenceType / validationMeaning
filterOptionalstringFilter by project name
includeGlobalOptionalbooleanInclude global infra projects
includeUnregisteredOptionalbooleanInclude unregistered compose projects

hack.project.status

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names

hack.project.up

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names

hack.project.down

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names

hack.project.restart

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names

hack.project.run

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names
serviceRequiredstringCompose service name
cmdOptionalstring[]Command arguments
workdirOptionalstringWorking directory inside container
timeoutMsOptionalnumberCommand timeout in ms

hack.project.logs.snapshot

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names
serviceOptionalstringSingle service name
servicesOptionalstringMultiple service names
queryOptionalstringRaw LogQL selector/query
lokiOptionalbooleanForce Loki backend
composeOptionalbooleanForce docker compose backend
tailOptionalnumberTail last N log lines
sinceOptionalstringStart time (RFC3339 or duration)
untilOptionalstringEnd time (RFC3339 or duration)

Tool-specific emitted data fields:

FieldTypePresence
data.eventsLogStreamEvent[]Present in source shape
data.countnumberPresent in source shape

hack.project.logs.tail

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
profilesOptionalstring[]Compose profile names
serviceOptionalstringSingle service name
servicesOptionalstringMultiple service names
queryOptionalstringRaw LogQL selector/query
lokiOptionalbooleanForce Loki backend
composeOptionalbooleanForce docker compose backend
tailOptionalnumberTail last N log lines
sinceOptionalstringStart time (RFC3339 or duration)
untilOptionalstringEnd time (RFC3339 or duration)
maxEventsOptionalnumberMax events to collect
maxMsOptionalnumberMax duration in ms

Tool-specific emitted data fields:

FieldTypePresence
data.eventsLogStreamEvent[]Present in source shape
data.countnumberPresent in source shape
data.stop_reasonstring (collector stop reason)Present in source shape
data.duration_msnumberPresent in source shape

hack.project.open

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
branchOptionalstringBranch/worktree name
targetOptionalstringTarget host/subdomain or URL

hack.project.init

source

InputPresenceType / validationMeaning
projectNameOptionalstringRegistered project name (from ~/.hack/projects.json)
repoRootOptionalstringRepo root path (absolute or relative)
pathOptionalstringPath inside a repo (absolute or relative)
nameOptionalstringProject slug
devHostOptionalstringDEV_HOST override
oauthOptionalbooleanEnable OAuth alias host
oauthTldOptionalstringOAuth alias TLD
manualOptionalbooleanSkip discovery and generate a minimal compose
noDiscoveryOptionalbooleanSkip discovery even if available

Prompt arguments

hack-init is a prompt, separate from hack.project.init. Mode defaults to existing-project. Prompt hints do not become init tool inputs.

ArgumentPresenceDeclaration
arguments.modeOptionalstring
arguments.projectNameOptionalstring
arguments.devHostOptionalstring

Common result

The emitted MCP transport subset is content[] with type/text, structuredContent, and isError on failure. The table describes the common structured payload, not every SDK extension. Optional data is declared unknown; it is not a machine-validated closed nested schema.

FieldTypePresence
structuredContent.okbooleanRequired
structuredContent.commandstringRequired
structuredContent.exitCodenumberRequired
structuredContent.stdoutstringRequired
structuredContent.stderrstringRequired
structuredContent.dataunknownOptional

Up/down/restart/init do not return a typed data status or readiness object. Open returns data.url without launching a browser. Status forwards the selected command JSON; a Compose result has project/branch/composeProject/items, and engine-specific item fields are open. Projects list forwards public CLI inventory JSON; consumers must tolerate version/runtime-specific metadata.

Run has no data object. Snapshot returns events/count. Tail adds stop_reason/duration_ms. Its maxEvents limit counts collected parsed events, unlike v5's type:log-only counter. Refusals use the common failure payload/stderr; this version does not promise v5's typed error object.

Log event fields

These are source types, not a closed validator for every parsed JSON line. Event type is start/log/heartbeat/error/end. Labels and fields are application-owned string maps. Do not enumerate application log keys as Hack API fields.

FieldTypePresence
data.events[].typeLogStreamEventTypeRequired in declared source type
data.events[].tsstringRequired in declared source type
data.events[].projectstringOptional
data.events[].backendLogStreamBackendOptional
data.events[].branchstringOptional
data.events[].servicesreadonly string[]Optional
data.events[].followbooleanOptional
data.events[].sincestringOptional
data.events[].untilstringOptional
data.events[].entryLogJsonEntryOptional
data.events[].messagestringOptional
data.events[].reasonstringOptional
data.events[].entry.source`"compose" \"loki"`
data.events[].entry.messagestringRequired in declared source type
data.events[].entry.rawstringRequired in declared source type
data.events[].entry.stream`"stdout" \"stderr"`
data.events[].entry.projectstringOptional
data.events[].entry.servicestringOptional
data.events[].entry.instancestringOptional
data.events[].entry.labelsRecord<string, string>Optional
data.events[].entry.timestampstringOptional
data.events[].entry.timestamp_nsstringOptional
data.events[].entry.levelLogLevelOptional
data.events[].entry.fieldsRecord<string, string>Optional

Contract boundaries

Nested engine/project/diagnostic variants and arbitrary application data remain open. Inspect the pinned public command source when handling a new variant; do not depend on private daemon/guest/compiler protocols. This field reference is source-reviewed and does not claim client-loading or cloud execution qualification.


Source: v4.2.4 · docs/site/reference/mcp-fields.md.

On this page