Reference / API reference

API reference

Every value exported by glove-foundry 0.5.1 and its subpaths, grouped by purpose, with the built-in agent tools, client methods, CLI, config keys and environment variables. Each group links to the handbook page that explains it.

Entry points

ImportExportsNotes
glove-foundryEverything on this page except the rows marked otherwiseESM only. Node 22 or newer.
glove-foundry/clientcreateFoundryClient, FoundryClient, FoundryRunHandle; types FoundryClientOptions, FoundryClientAuthorizationAdapter, FoundryHealth, FoundrySteerHandleResult, WaitOptionsNo runtime imports: safe in browsers, route handlers and voice hosts.
glove-foundry/configdefineConfig, DEFAULT_FOUNDRY_CONFIG; types FoundryConfig, FoundryExecutionConfig, FoundryBrandingConfigDEFAULT_FOUNDRY_CONFIG is only exported here.
glove-foundry/stationstationDaemon; types FoundryStationDaemonOptions, FoundryStationDaemonAdapter, FoundryStationConnection, FoundryStationResourcesOnly exported here.
glove-foundry/voicevoiceCall, webSocketRoom, announceDelegationUpdate, announceMeshMessage, VOICE_EXCLUDED_FOUNDRY_TOOLS; types VoiceCallOptions, VoiceCallResult, FoundryVoiceRoom, FoundryVoiceCall, WebSocketRoomOptions, VoiceRoomClientMessage, VoiceRoomServerMessageOnly exported here. See Voice agents.
glove-foundry/eslintfoundryEslintConfig (also the default export), foundryEslintPluginRequires eslint 9+ (optional peer dependency).
bin glove, glove-foundryThe CLISee CLI.

Agents & assembly

Guide: defineAgent & assembly

ExportKindPurpose
defineAgentfunctionDefine the agent in agents/<route>/agent.ts (the route is its id). Needs description and either model + systemPrompt or run/spawn. Every other field is a value or a resolver (definition, ctx) => value.
defineAgentFromModulefunctionNormalize a module's default defineAgent(...) export, or its named convention exports (description, model, tools, …), into a definition for a route.
defineSubagentfunctionGlove subagent with its own prompt, store and optional least-privilege tool projection from the parent. See Multi-agent.
defineCallfunctionTyped in-run function with Zod input/output; also a model tool unless exposeToAgent: false. Called from code with ctx.invoke.
defineRoutesfunctionFreeze a hand-written route → agent-module map for use as the client's type parameter (the generated FoundryRoutes type does this for you).
isFoundryAgentDefinitionfunctionType guard for values created by defineAgent.
isFoundryAgentfunctionAlias of isFoundryAgentDefinition.

Types: AnyFoundryAgent, AgentAssemblyContext, AgentAssemblyOptions, AgentFactoryContext (deprecated), AgentHandlerContext, AgentRuntimeControls, DefineAgentOptions, FoundryAgent, FoundryAgentDefinition, DefineFoundrySubagentOptions, FoundrySubagentToolContext, FoundryHookDefinition, FoundryCall, FoundryCallContext, FoundryCallOptions, FoundryExecutionContext, FoundryResolver, FoundryListResolver, FoundryAgentConventionModule, FoundryAgentMode, FoundryRouteMap, InferAgentInput, InferAgentOutput, FoundryMeshConfig, FoundryDelegate, FoundryDelegateOptions, FoundryDelegation, FoundryDelegationStatus, FoundryDelegationUpdate, FoundryDelegationReply

Instances, conversations & data

Guide: Definitions & instances

ExportKindPurpose
createAgentInstancefunctionInstance record from a definition id string: (definitionId, { id?, workspaceId?, name?, description?, context?, installations?, playbooks? }). Defaults: id agent_<uuid>, workspace "default". name and description are who the agent is to people and to its peers on the mesh.
defineAgentInstancefunctionThe same from an imported definition value — the code-authoring form for seeded instances.
reconstructAgentInstancefunctionRehydrate a persisted instance into Foundry's frozen runtime shape (for custom data adapters).
createConversationfunctionConversation record for an instance: (agent, { id?, title?, context?, workspaceId? }). See Conversations.
MemoryFoundryDataAdapterclassIn-process FoundryDataAdapter; the default when the application sets no data. Private to each process and lost on restart. Seeds: agents, conversations, subscriptions, activations, environment.
FileFoundryDataAdapterclassDurable single-host adapter: one JSON file, advisory lock between processes (lockTimeoutMs 10 000, staleLockMs 30 000), atomic rename. Same seeds; inserted only when absent.
fileTopologyStorefunctionfileTopologyStore(file): a TopologyStore layer that keeps routes and bindings in one JSON file, written by atomic rename, so runtime putRoute/putBinding survive restarts on one host. Use in defineApplication({ services }) with your AccountDirectory and memoryEventStore.
toGloveMessagefunctionConvert a FoundryMessageInput (string or content parts) into the native Glove user Message.
toGloveRequestInputfunctionClone a FoundryMessageInput into the mutable input Glove.processRequest accepts.

Types: AgentInstance, Conversation, CreateAgentInstanceOptions, UpdateAgentInstanceOptions, CreateConversationOptions, UpdateConversationOptions, EnvironmentValue, FoundryDataAdapter, FoundryActivationRecord, FoundryMessageInput, InboundDeliveryClaim, ProvisionAgentOptions, FoundryRequest, FoundryResult, FoundrySuspension, FoundryTask, FoundryWorkingEnvironmentSnapshotOwner, SharedInboxItem, WorkspaceEntry, FileFoundryDataAdapterOptions

Composition & capabilities

Guide: Tools, MCP & memory

ExportKindPurpose
composeAgentfunctionMerge colocated tools, apps, MCP servers, memory profiles, layers and subscribers into the definition's components catalogue. A catalogue only: tools, apps and MCP mount when an instance installs them.
EMPTY_AGENT_COMPOSITIONconstcomposeAgent() with nothing in it.
defineSharedToolfunctionInstallable tool (*.tool.ts), optionally with a config schema.
defineAgentApplicationfunctionInstallable application (*.app.ts): inbound/outbound transmissions, connections, an install Effect that contributes tools, and mcp: { entry, auth, tools } for an MCP server opened with the installation's account (auth(session) returns headers or stdio environment; tools(tool, ctx) returns "allow" | "ask" | "hide", default: reads run, the rest ask). Outbound transmissions become glove_app_*_send tools.
defineAppfunctionAlias of defineAgentApplication.
restrictAppfunctionNarrow an app's tools, account operations and transmissions: restrictApp(app, { tools, operations, transmissions }). Omitted lists deny access; inherited grants cannot exceed the parent's.
defineMcpfunctionInstallable MCP server over HTTP or stdio (*.mcp.ts).
defineMemoryfunctionMemory profile (*.memory.ts), mounted through the definition's memory field.
configureMemoryfunctionSelect a memory profile with typed config: configureMemory(profile, config).
installfunctionInstallation data for an instance: install(definition, config?, { account? }) → AgentInstallation (kind is tool, application or mcp).
installationKeyfunction"<kind>:<id>" key used to de-duplicate installations (last write wins).
defineLayerfunctionNative surface (*.layer.ts) whose setup Effect mounts any Glove package on the assembled runnable.
configureLayerfunctionSelect a layer with typed config: configureLayer(layer, config).
defineSubscriberfunctionSubscriber surface (*.subscriber.ts) receiving the run's Glove events.
isFoundryCapabilityfunctionTrue for shared tools, applications, MCP servers and memory profiles.
isFoundryLayer, isFoundrySubscriberfunctionBrand guards.
isInboxCapableStorefunctionTrue when a StoreAdapter implements getInboxItems, addInboxItem, updateInboxItem, getResolvedInboxItems (needed by inboxes and legacy mesh inbox delivery).
EMPTY_CAPABILITY_REGISTRY, EMPTY_NATIVE_REGISTRYconstEmpty catalogues.

Types: FoundryAgentComponent, FoundryAgentComposition, FoundryCompositionSource, FoundryToolBody, AgentApplicationOptions, AgentApplicationContribution, AgentApplicationInstallContext, AgentInstallContext, AgentDefinitionSurfaceContext, AgentInstallation, AgentInstallationKind, InstallationSelection, FoundryInstallable, FoundryCapabilityKind, FoundryAgentApplication, FoundryApp, FoundryAccountSessionAdapter, FoundryCapabilityRegistry, FoundryCapabilityManifest, FoundryCapabilityManifestEntry, FoundryMcp, FoundryMcpOptions, FoundryResolvedMcp, FoundryMemoryProfile, FoundryMemoryReference, DefinitionConfigInput, FoundryMemorySelection, FoundryMemoryProfileOptions, FoundrySharedTool, McpAdapterFactory, SharedToolOptions, FoundryLayer, FoundryLayerOptions, FoundryLayerReference, FoundryLayerSelection, FoundryNativeManifest, FoundryNativeManifestEntry, FoundryNativeRegistry, FoundrySubscriber, FoundrySubscriberOptions, FoundrySubscriberSelection, FoundrySurfaceContext

Integrations: transmissions, apps, connections & topology

Guide: Apps & transmissions

ExportKindPurpose
defineTransmissionfunctionProvider-neutral transport (*.transmission.ts) with inbound/outbound Effect schemas and adapters.
defineTransmissionEventfunctionNamed inbound or outbound event of a transmission (*.event.ts).
defineTransmissionPredicatefunctionParameterized match predicate for playbooks (*.predicate.ts).
transmissionPredicatefunctionFind a predicate on a transmission's inbound contract: transmissionPredicate(transmission, id).
isFoundryTransmissionfunctionBrand guard.
serializeInboundTransmissionXmlfunctionDefault XML rendering of an inbound event as the agent's user turn (used when the transmission has no serialize).
defineConnectionfunctionLong-lived inbound connection (socket, poller) for an application (*.connection.ts); calls receive per event.
defineAccountfunctionTyped account reference for a transmission: id and metadata, never credentials.
defineInboundRoute, defineOutboundRoutefunctionRoute records with typed per-transmission config.
defineBindingfunctionBind an instance, application, transmission, account, route and capabilities into an AgentBinding.
installedApplicationTransmissionToolNamefunctionName of an installed app's generated outbound tool: glove_app_<app>__<transmission>_send.
createInstalledApplicationTransmissionToolsfunctionBuild those generated tools for an assembly context (the runtime does this).
compileApplicationManifestfunctionCompile transmissions into a credential-free manifest (Effect; fails with ManifestCompilationError).
FoundryApplicationManifest, FoundryManifestCapability, FoundryManifestTransmissionEffect SchemaManifest schemas (also exported as types).
GrantResolverContext tagEffect service that resolves bindings into one run's RunGrant.
grantResolverLiveLayerDefault GrantResolver.
AccountDirectory, TopologyStore, EventStoreContext tagEffect services for account metadata, routes/bindings and event payloads; replace them with the application's services layer.
memoryAccountDirectoryfunctionIn-memory AccountDirectory layer from a list of accounts.
memoryTopologyStore, memoryEventStoreLayerIn-memory defaults.

Types: AccountContract, AnyFoundryTransmission, CapabilityDefinition, EgressAdapter, EgressContext, FoundryTransmission, FoundryTransmissionEvent, InboundContract, FoundryTransmissionPredicate, InferAccountMetadata, InferInboundEvent, InferInboundConfig, InferOutboundConfig, InferOutboundInput, InferOutboundOutput, IngressAdapter, IngressContext, OutboundContract, TransmissionOptions, TransmissionEventDirection, TransmissionEventOptions, TransmissionPredicateOptions, TransmissionSerializationContext, DefineAccountOptions, DefineBindingOptions, DefineInboundRouteOptions, DefineOutboundRouteOptions, ApplicationConnectionContext, ApplicationConnectionState, ApplicationConnectionStatus, ConnectionReceiveInput, DefineConnectionOptions, FoundryApplicationConnection, ResolveGrantRequest, AccountFilter, AccountSessionAdapter, AccountSessionRequest, BindingFilter, RouteFilter

Playbooks & subscriptions

Guide: Playbooks, schedules & sleep

ExportKindPurpose
composePlaybookfunctionRuntime playbook (match, directives, outbound routes) composed from imported transmission primitives; returned from the definition's playbooks field.
definePlaybookActionfunctionNamed action a playbook directive references (*.action.ts).
reconstructPlaybookfunctionRehydrate a stored playbook into the frozen runtime shape.
definePlaybookSubscriptionfunctionDurable subscription evaluated even when no instance exists (*.subscription.ts); provisions targets by policy: singleton, per-thread, per-event, existing, custom.
reconstructPlaybookSubscriptionfunctionRehydrate a stored subscription.

Types: AgentPlaybookInput, ComposedAgentPlaybook, ComposedAgentPlaybookInput, PlaybookMatchInput, PlaybookOutboundInput, AgentPlaybook, FoundryPlaybookAction, PlaybookActionOptions, PlaybookDirective, PlaybookDirectiveInput, PlaybookMatch, PlaybookOutboundDirective, AgentProvisioningPolicy, CustomProvisionedAgent, CustomProvisioningContext, DefinePlaybookSubscriptionOptions, FoundryInstanceProvisioner, PlaybookSubscription, PlaybookSubscriptionTarget, PlaybookSubscriptionTargetInput

Schedules & built-in tools

Guide: Playbooks, schedules & sleep

ExportKindPurpose
defineSchedulefunctionAgent-local schedule { name, message, timing, payload?, enabled?, description? } returned from the schedules field. timing: at, after, every or cron (timezone default UTC).
isFoundrySchedulefunctionBrand guard.
createFoundryCoreToolsfunctionBuild the built-in glove_foundry_* tools for an assembly context. The runtime mounts them on every run the definition's builtins policy allows.
FOUNDRY_BUILTIN_TOOLSconstEvery built-in tool as { name, group, workspaceWide }. group is scheduling, spawning, transmission, conversations, workspace, environment, delegation, messaging or mesh; workspaceWide marks tools that reach the whole workspace or every conversation of the instance.
builtinAllowedfunctionbuiltinAllowed(policy) → (name) => boolean: whether a tool is on under a builtins policy. Names that are not built-ins are always on.
isFoundryBuiltinfunctionWhether a tool name is one of Foundry's built-ins.
FOUNDRY_CORE_COMMAND_EVENTconst"foundry.core.command" — the event type that carries tool-issued commands to the runtime.

Types: DefineFoundryScheduleOptions, FoundryScheduleDefinition, FoundryScheduleTiming, FoundryScheduleTimingInput, FoundryCoreCommand, FoundryBuiltinsPolicy, FoundryBuiltinTool, FoundryBuiltinGroup

Mesh

Guide: Multi-agent: the mesh

ExportKindPurpose
meshIdentityfunctionHow an instance appears to its peers on the mesh: { id, name, description, metadata: { definitionId } }, from the instance's name and description (the id when there is no name).
DEFAULT_MESH_REFUSALconst"Your message could not be sent.": what a sender reads when the application's mesh refuses and gives no wording.

Types: FoundryMeshOptions, FoundryMeshThread, FoundryMeshThreadStatus, FoundryMeshMessage, FoundryMeshParty, FoundryApplicationMesh, FoundryMeshPeer, FoundryMeshSend, FoundryMeshDecision, FoundryMeshThreadStart, FoundryMeshRecordedMessage, FoundryMeshHookContext, FoundryMeshHeldMessage, FoundryMeshOutgoing

Working environment & REPL

Guide: Working environments

ExportKindPurpose
defineWorkingEnvironmentfunctionSandboxed persistent VFS plus named scripts for the workingEnvironment field.
defineReplfunctionOne native JavaScript, Python or Lisp REPL for the repl field, with optional programmatic tool calling (programmaticTools: select receives tools and apps, one group per installed app; keepDirect: false keeps selected tools out of context; maxCalls default 50, max 1000).
foundryDataEnvironmentPersistencefunctionVFS persistence through the data adapter's private snapshot methods: foundryDataEnvironmentPersistence({ scope: "agent" | "conversation" | "workspace" }) (default agent; workspace is one tree shared by every agent in the workspace).

Types: DefineFoundryReplOptions, DefineFoundryWorkingEnvironmentOptions, FoundryJavaScriptReplDefinition, FoundryLispReplDefinition, FoundryMountedRepl, FoundryProgrammaticToolContext, FoundryProgrammaticToolSelection, FoundryProgrammaticTools, FoundryPythonReplDefinition, FoundryReplDefinition, FoundryVfs, FoundryVfsHandle, FoundryWorkingEnvironmentCreateContext, FoundryWorkingEnvironmentDefinition, FoundryWorkingEnvironmentPersistenceAdapter, FoundryWorkingEnvironmentPersistenceContext

Guidance

Guide: Goals, facts & forms

ExportKindPurpose
defineGoals, defineFacts, defineFormsfunctionFreeze options for the definition's goals, facts and forms fields. Pure values; no runtime state.
foundryGuidanceSubjectfunctionStable subject key for guidance state: foundryGuidanceSubject(ctx, "conversation" | "instance") (default conversation).

Types: FoundryFactsOptions, FoundryGoalsOptions, FoundryFormsOptions, FoundryGuidanceHandles, FoundryGuidanceScope

Runtime, server & client

Guide: Client & HTTP API

ExportKindPurpose
defineApplicationfunctionDefault export of foundry.application.ts: name plus optional data, conversationStore, accounts, routes, bindings, requestAuthorization, provisioner, approvals, mesh (peers, gate, record binding and commit for the hosted mesh), services, daemon.
isFoundryApplicationfunctionBrand guard.
EMPTY_FOUNDRY_APPLICATIONconstdefineApplication({ name: "Glove Foundry" }), used when there is no application file.
FoundryRuntimeclassThe control process: FoundryRuntime.discover({ rootDir, agentsDir, application?, applicationFilePath?, config? }), then start() / stop(). Owns data, activations, approvals, delegations, durable workers, mesh threads and the execution daemon; every HTTP endpoint calls one of its methods. listDelegations({ agentId?, conversationId?, status? }) lists delegations, newest first; listSubagents(parentId) lists durable workers; listThreads({ agentId?, conversationId?, to?, status? }) lists mesh threads by who started them, the conversation that started them, the recipient or status; meshHumanMessage(threadId, { authorId, name?, text, id? }) puts a person's message in a thread; meshTakeOver(threadId, { by, agentId? }) takes agents out of one; releaseMeshMessage(threadId, messageId, "deliver" | "discard") decides a message the application's gate held.
FoundryRuntimeErrortagged error classError of the runtime's Effect APIs (operation, message).
FoundryServerclassHTTP server for the inspector, /api, /v1 and /health: new FoundryServer(runtime, { host?, port?, branding?, messageBodyBytes? }), listen() → { host, port, url }, close().
createFoundryClientfunctionTyped HTTP client; also exported by glove-foundry/client. Options: baseUrl (default http://127.0.0.1:4141), fetch, authorization.
FoundryClientclassThe client class (see the method list below).
FoundryRunHandleclassReturned by send and agent(route).request: id, initial, get(), wait({ pollMs: 150, timeoutMs: 60_000 }), cancel(), steer(message), events().
discoverAgentsfunctionImport every agent file under agentsDir and return DiscoveredAgent[] ({ agentsDir, strictFileRoutes?, cacheBust? }).
findAgentFilesfunctionList agent files under a directory: agent.*, <route>/agent.*, <route>.agent.* (.ts, .tsx, .mts, .js, .mjs).
routeFromAgentFilefunctionRoute for an agent file path, or null. A root agent.ts is the route default.
createManifestfunctionBuild the FoundryManifest (per-agent tools, calls, schedules, lazy fields …).
writeGeneratedTypesfunctionWrite .foundry/routes.d.ts (the FoundryRoutes type) and .foundry/manifest.json. The CLI runs it on every start.

Types: FoundryApplication, FoundryApplicationOptions, FoundryRequestAuthorizationAdapter, FoundryRequestAuthorizationInput, FoundryRuntimeOptions, FoundryRun, FoundrySteerResult, FoundryConversationTranscript, FoundryServerOptions, FoundryClientOptions, FoundryClientAuthorizationAdapter, FoundryHealth, FoundrySteerHandleResult, WaitOptions, DiscoveredAgent, FoundryManifest, FoundryManifestAgent

Approvals

Guide: Approvals & steering

ExportKindPurpose
FoundryApprovalDisplayManagerclassDefault display manager inside agent runs; turns a permission prompt into an approval record and waits for the decision, then suspends the turn when approvals are durable.
withFoundryPermissionsfunctionWrap a store that lacks getPermission/setPermission with a per-run, exact-input permission overlay.
createFoundryApproval, listFoundryApprovals, resolveFoundryApprovalfunctionFile-directory approval records shared by job processes and the control process. Hosts use client.approvals() and client.resolveApproval(id, "approve" | "deny") instead.

Types: FoundryApproval, FoundryApprovalDecision, FoundryApprovalStatus

Observability

Guide: Inspector & WebChat

ExportKindPurpose
MemoryObservabilityAdapterclassDefault in-memory event log (maxEvents, default 10 000 via config). Supply your own FoundryObservabilityAdapter as FoundryRuntimeOptions.observability.

Types: EventFilter, FoundryEvent, FoundryEventCategory, FoundryObservabilityAdapter

Config

Guide: Project structure

ExportKindPurpose
defineConfigfunctionType-checked foundry.config.ts; unknown keys are type errors. Also exported by glove-foundry/config. Keys below.

Types: FoundryConfig, FoundryExecutionConfig, FoundryBrandingConfig

Domain schemas & errors

Guide: Apps & transmissions

ExportKindPurpose
AccountId, AgentDefinitionId, AgentId, BindingId, CapabilityId, EventId, RouteId, RunId, TransmissionIdEffect SchemaBranded id schemas (each name is also its type).
AccountReference, AccountSummary, AgentBinding, InboundRoute, OutboundRoute, Route, ReplyPolicy, RunGrant, EventReferenceEffect SchemaTopology and grant records (each name is also its type).
AccountNotFound, AccountSessionUnavailable, BindingNotFound, EventNotFound, GrantResolutionError, RouteNotFound, TopologyConflicttagged error classDomain errors; FoundryDomainError is their union.
ManifestCompilationErrortagged error classRaised by compileApplicationManifest.

Types: FoundryDomainError

Advanced & internal

Guide: defineAgent & assembly

ExportKindPurpose
FOUNDRY_AGENT_DEFINITION_BRAND, FOUNDRY_AGENT_BRAND (deprecated alias), FOUNDRY_SHARED_TOOL_BRAND, FOUNDRY_AGENT_APPLICATION_BRAND, FOUNDRY_MCP_BRAND, FOUNDRY_MEMORY_BRAND, FOUNDRY_LAYER_BRAND, FOUNDRY_SUBSCRIBER_BRAND, FOUNDRY_SCHEDULE_BRAND, FOUNDRY_TRANSMISSION_BRAND, FOUNDRY_TRANSMISSION_EVENT_BRAND, FOUNDRY_TRANSMISSION_PREDICATE_BRAND, FOUNDRY_CONNECTION_BRAND, FOUNDRY_PLAYBOOK_ACTION_BRAND, FOUNDRY_COMPOSED_PLAYBOOK_BRAND, FOUNDRY_APPLICATION_BRAND, FOUNDRY_WORKING_ENVIRONMENT_BRAND, FOUNDRY_REPL_BRANDsymbolSymbol.for(...) brands the define* helpers stamp on their results; the is* guards read them.
FOUNDRY_APPLICATION_ENV, FOUNDRY_AGENT_ROUTE_ENV, FOUNDRY_AGENT_FILE_ENV, FOUNDRY_APPROVAL_DIRECTORY_ENVconstNames of the internal environment variables listed below.
FOUNDRY_EVENT_PREFIX, FOUNDRY_EXECUTION_MARKERconst"__GLOVE_FOUNDRY_EVENT__" (prefix of event lines a job writes to stdout) and "__glove_foundry_execution_v1" (marks a run's input envelope).
internalAgentName, routeFromInternalAgentNamefunctionRoute ↔ execution name: support/triage ↔ foundry_support__triage.
installRegistry, mountAgentDefinitionMemory, mountFoundrySurfacesfunctionThe mount steps assembly runs for installations, memory, and layers/subscribers. Use them only when hosting definitions outside the runtime.

Station (glove-foundry/station)

Guide: Browser & sandbox agent

ExportKindPurpose
stationDaemonfunctionConfigure the managed execution daemon for defineApplication({ daemon }): stationId (required, [a-zA-Z0-9_-], 1–128 chars), name?, port? (omitted: a free loopback port), resources?() → { browser?, sandbox? }, onReady?(connection) with { url, stationId, token }.

Voice (glove-foundry/voice)

ExportKindPurpose
voiceCallfunctionReturns a run that hosts a live call over the assembled agent: { room, greeting?, idleMs?, maxDurationMs?, openDelayMs?, transcript?, realtime?, announce?, offCall? }. The agent's model must be s2sDrivenModel(...), or pass realtime.adapter.
webSocketRoomfunctionA room served by the run on its own port: { port, token, host?, path?, sampleRate?, agentName?, model? }. PCM16 both ways plus JSON captions and state.
announceDelegationUpdatefunctionThe default wording for a delegation update put to the model mid-call.
announceMeshMessagefunctionThe default wording for a mesh message (a reply, a failure or a question from another agent) put to the model mid-call.
VOICE_EXCLUDED_FOUNDRY_TOOLSconstFoundry tools kept off every call. Tools with requiresPermission are kept off too.

ESLint (glove-foundry/eslint)

Guide: Project structure. foundryEslintConfig is a flat-config object named glove-foundry/recommended for **/*.{ts,tsx,mts,js,mjs} that enables three rules as errors.

eslint.config.jstypescript
import tseslint from "typescript-eslint";
import foundry from "glove-foundry/eslint";

export default [
  { ignores: [".foundry/**"] },
  ...tseslint.configs.recommended,
  foundry,
];
RuleReports
glove-foundry/no-agent-contractsinput/output passed to defineAgent or exported from an agent module.
glove-foundry/no-file-definition-idAn id passed to a file-routed helper (defineAgent, defineSharedTool, defineApp, defineMcp, defineMemory, defineLayer, defineSubscriber, defineTransmission*, defineConnection, definePlaybookAction, definePlaybookSubscription, …).
glove-foundry/no-raw-definition-referencesString ids where an imported definition is expected: transmissionId, applicationId, routeId, routeIds, literal event/action and applicationAccountId in composePlaybook; accountId in install config.

Built-in agent tools

Mounted on every assembled run unless the definition's builtins policy withholds them; no installation needed. Guides: Automation, Conversations, Multi-agent. Definitions with subagents also get Glove's glove_invoke_subagent;mesh adds the four glove_mesh_* tools at the end of the table (unless its mount leaves them out of a run); calls with exposeToAgent appear under their own names.

ToolInputEffect
glove_foundry_spawn{ message, definitionId?, agentId?, conversationId?, payload? }Queue a run now. Omitted agentId/conversationId create new ones. Returns a command id only.
glove_foundry_schedule{ message, timing, definitionId?, agentId?, conversationId?, payload? }Create a future or recurring activation. timing: { kind: "at", at }, { kind: "after", duration }, { kind: "every", interval }, { kind: "cron", expression, timezone }.
glove_foundry_schedules{ action: "list" | "update" | "pause" | "resume" | "cancel", … }Manage this instance's schedules; list takes status (active default, paused, completed, cancelled, all).
glove_foundry_sleep{ kind: "until", at } | { kind: "for", duration }, message?Suspend, then wake the same instance and conversation. Default message: "Continue the suspended work."
glove_foundry_background{ message, definitionId?, payload?, reconvene? }Queue a run on the same instance and conversation; reconvene (default true) posts a background.reconvene shared inbox item.
glove_foundry_transmit{ routeId, payload }Deliver through an outbound route this instance's playbooks declare and this run is authorized for. Asks for approval when the route's transmission requires it.
glove_foundry_conversations{}List this instance's conversations.
glove_foundry_workspace{ action: "get" | "set" | "list", key?, value? }Read or write workspace entries.
glove_foundry_shared_inbox{ action: "list" | "post" | "update", … }List, post (topic, payload, agentId?, conversationId?) or set status.
glove_foundry_tasks{ action: "list" | "create" | "update", … }List, create (title, detail?) or set status.
glove_foundry_environment{}List non-secret environment values for this workspace, instance and conversation.
glove_foundry_message{ to, message, delivery?: { id?, conversationId?, whenIdle?, deferTimeoutMs?, expiresAt? } }Message a declared durable child or parent through the persistent event journal. Returns durable acceptance, not completion.
glove_foundry_delegate{ to, task }With delegates or durableSubagents. Hand a task to a sibling or owned durable worker; returns { delegationId, to, status } at once. The result or a question comes back as a <delegation> message.
glove_foundry_reply{ delegationId, message }With delegates or durableSubagents. Answer a delegate's question, or send more instructions about a delegation this conversation started.
glove_foundry_ask{ question }Only on a run working on a delegated task. Ask the delegating agent; waits up to answerWaitMs for the answer, then suspends the run.
glove_mesh_list_agents{ name? }Only with hosted mesh. The agents this one can message: id, name and description from each instance.
glove_mesh_send_message{ to, content, in_reply_to?, blocking? }Only with hosted mesh. Message an agent by instance id. A new message starts a thread; the recipient's final reply, or a question it sends, comes back as a <mesh-message> message. in_reply_to answers a message in a thread. blocking waits up to waitMs in the run, then the run suspends until the reply arrives.
glove_mesh_broadcast{ content }Only with hosted mesh. Start a thread with every agent this one can message.
glove_mesh_acknowledge{ message_id, note? }Only with hosted mesh. Tell an agent its message arrived without answering yet; it reaches only a run that is waiting.
glove_app_<app>__<transmission>_send{ routeId, payload }Generated per outbound transmission of each installed application.

Client methods

FoundryClient methods and the native endpoints they call. Every method throws the server's error message on a non-2xx response. Full detail: Client & HTTP API.

MethodsEndpoint
health()GET /health
agent(route).create(options) · createAgent(definitionId, options) · agentInstances(definitionId?)POST · GET /api/agent-instances
agent(route).request(request)POST /api/agents/:route/runs
configureAgent(agentId, { name?, description?, context?, installations?, playbooks? }) · setAgentPlaybooks(agentId, playbooks)PATCH /api/agent-instances/:id · PUT …/:id/playbooks
installations(agentId) · install(agentId, installation) · uninstall(agentId, installation)GET · PUT · DELETE /api/installations
createConversation · conversations · updateConversation · conversationTranscript/api/conversations[/:id[/messages]]
send(agentId, conversationId, message, { payload?, context? })POST /api/conversations/:id/messages
getRun · runs(route?) · cancelRun · steerRun · getEvents(filter?)/api/runs/:id · /api/runs · …/cancel · …/steer · /api/events
approvals(filter?) · resolveApproval(id, decision)GET /api/approvals · POST /api/approvals/:id
threads(filter?) · thread(threadId)GET /api/threads · GET /api/threads/:id
meshHumanMessage(threadId, input) · meshTakeOver(threadId, options) · releaseMeshMessage(threadId, messageId, decision)POST /api/threads/:id/messages · POST …/take-over · POST …/held/:messageId
workspaceEntries · putWorkspaceEntry · sharedInbox · postSharedInbox · updateSharedInbox · tasks · createTask · updateTask · dataEnvironment/api/workspaces/:ws/{entries,inbox,tasks,environment}
dispatchInbound(input) · dispatchOutbound(input)POST /api/transmissions/:routeId/{fire,deliver}
playbookSubscriptions · putPlaybookSubscription · deletePlaybookSubscription · activations/api/playbook-subscriptions · /api/activations
applicationConnections() · reconnectApplicationConnection(id)/api/application-connections[/:id/reconnect]
manifest() · capabilities(definitionId) · surfaces(definitionId)GET /api/manifest · /api/capabilities · /api/surfaces
accounts · routes · putRoute · removeRoute · bindings · putBinding · removeBinding · resolveGrant/api/accounts · /api/routes · /api/bindings · /api/grants/resolve

Endpoints without a client method: GET /health/detailed, GET /api/agents, GET /api/transmissions, GET /api/runs/:id/events, and the OpenAI-compatible and automation routes GET /v1/models, POST /v1/chat/completions, POST /v1/responses, GET /v1/capabilities, POST /v1/runs, GET /v1/runs/:id, GET /v1/runs/:id/events, POST /v1/runs/:id/stop, POST /v1/runs/:id/steer, GET /v1/approvals, POST /v1/approvals/:id (see OpenAI-compatible API). Any other GET outside /api, /v1 and /health serves the inspector.

CLI

Both bins run the same program; glove foundry <command> and glove-foundry <command> are equivalent. Guide: Install & CLI.

CommandWhat it does
glove foundry init [directory]Create a project (interactive in a terminal). glove foundry my-app is the same. Non-interactive default directory: glove-foundry-app.
glove foundry devRun the runtime and inspector, restarting on changes to the agents directory, .env, .env.local, foundry.application.*, foundry.config.* and root tools/, applications/, mcp/, memory/, inboxes/.
glove foundry startRun without file watching.
glove foundry helpPrint usage (also --help, -h).
FlagApplies toMeaning
--template travel-concierge|minimalinitDefault travel-concierge.
--target standalone|nextjsinitDetected: a directory holding a Next.js app gets nextjs.
--package-manager pnpm|npm|yarn|buninitDetected from lockfiles.
--yes, --no-interactiveinitAccept defaults without prompts; installs only with --install.
--interactiveinitRequire a terminal; cannot combine with --yes.
--install / --no-installinitInstall dependencies now, or print the command.
--root <dir>dev, startProject root (default: current directory).
--port <n>, --host <addr>dev, startOverride server.port / server.host.
--no-watchdevDisable hot restart.

On every start the CLI loads foundry.config.{ts,mts,js,mjs} (default export), loads the application file if present, discovers agents and writes .foundry/routes.d.ts and .foundry/manifest.json.

defineConfig keys

foundry.config.tstypescript
import { defineConfig } from "glove-foundry/config";

export default defineConfig({
  server: { port: 4141 },
  execution: { maxConcurrent: 10, maxAttempts: 2 },
  branding: { name: "Acme Support", accent: "#0f766e" },
});
KeyDefaultNotes
agentsDir"agents"Where agent folders live ("foundry/agents" in the Next.js target).
applicationFile"foundry.application.ts"Infrastructure file; optional.
server.host"127.0.0.1"Non-loopback hosts require requestAuthorization.
server.port4141--port overrides it.
server.messageBodyBytes1048576 (1 MB)JSON limit for message-bearing endpoints; 1 MB to 128 MB.
execution.maxConcurrent5Runs executing at once.
execution.maxAttempts1Attempts per run.
execution.retryBackoffMs1000Delay between attempts.
execution.pollIntervalMs100Queue poll interval.
execution.idlePollIntervalMs1000Deprecated; not forwarded to the Station 3 daemon.
observability.maxEvents10000Events kept by the in-memory log.
branding.name / label / descriptor / accent"Glove Foundry" / — / "Inspector" / —Inspector shell; accent is a six-digit hex colour.
strictFileRoutestrueReject an agent module whose deprecated id export differs from its file route.

Environment variables

Foundry itself reads very little from the environment. Model and provider keys are read by your own code and adapters, never by Foundry.

VariableMeaning
.env, .env.localLoaded from the project root by glove foundry dev / start (.env first). A variable that is already set is never overwritten.
GLOVE_FOUNDRY_APPLICATION_FILESet by the runtime for the execution daemon and job processes: absolute path of foundry.application.ts, which each process imports. Unset when there is no application file.
GLOVE_FOUNDRY_APPROVAL_DIRECTORYSet by the runtime: private directory for approval records.
GLOVE_FOUNDRY_CORE_COMMAND_DIRECTORYSet by the runtime: private directory for tool → runtime command requests (transmit calls).
GLOVE_FOUNDRY_AGENT_ROUTE, GLOVE_FOUNDRY_AGENT_FILERead only by the legacy execution-agent entrypoint; the daemon passes agent identity explicitly.
STATION_SIGNAL_RUN_IDSet by Station in each job process; becomes ctx.runId ("unknown" if absent).
npm_config_user_agentRead by init to detect the package manager when there is no lockfile.
NODE_OPTIONS, LD_PRELOAD, LD_LIBRARY_PATH, DYLD_INSERT_LIBRARIESRemoved from the environment of the execution daemon.
FOUNDRY_URLNot read by Foundry. The generated Next.js lib/foundry.ts uses it as the client baseUrl.