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
| Import | Exports | Notes |
|---|---|---|
glove-foundry | Everything on this page except the rows marked otherwise | ESM only. Node 22 or newer. |
glove-foundry/client | createFoundryClient, FoundryClient, FoundryRunHandle; types FoundryClientOptions, FoundryClientAuthorizationAdapter, FoundryHealth, FoundrySteerHandleResult, WaitOptions | No runtime imports: safe in browsers, route handlers and voice hosts. |
glove-foundry/config | defineConfig, DEFAULT_FOUNDRY_CONFIG; types FoundryConfig, FoundryExecutionConfig, FoundryBrandingConfig | DEFAULT_FOUNDRY_CONFIG is only exported here. |
glove-foundry/station | stationDaemon; types FoundryStationDaemonOptions, FoundryStationDaemonAdapter, FoundryStationConnection, FoundryStationResources | Only exported here. |
glove-foundry/eslint | foundryEslintConfig (also the default export), foundryEslintPlugin | Requires eslint 9+ (optional peer dependency). |
bin glove, glove-foundry | The CLI | See CLI. |
Agents & assembly
Guide: defineAgent & assembly
| Export | Kind | Purpose |
|---|---|---|
defineAgent | function | Define 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. |
defineAgentFromModule | function | Normalize a module's default defineAgent(...) export, or its named convention exports (description, model, tools, …), into a definition for a route. |
defineSubagent | function | Glove subagent with its own prompt, store and optional least-privilege tool projection from the parent. See Multi-agent. |
defineCall | function | Typed in-run function with Zod input/output; also a model tool unless exposeToAgent: false. Called from code with ctx.invoke. |
defineRoutes | function | Freeze a hand-written route → agent-module map for use as the client's type parameter (the generated FoundryRoutes type does this for you). |
isFoundryAgentDefinition | function | Type guard for values created by defineAgent. |
isFoundryAgent | function | Alias of isFoundryAgentDefinition. |
Types: AnyFoundryAgent, AgentAssemblyContext, AgentAssemblyOptions, AgentFactoryContext (deprecated), AgentHandlerContext, AgentRuntimeControls, DefineAgentOptions, FoundryAgent, FoundryAgentDefinition, DefineFoundrySubagentOptions, FoundrySubagentToolContext, FoundryHookDefinition, FoundryCall, FoundryCallContext, FoundryCallOptions, FoundryExecutionContext, FoundryMeshConfig, FoundryResolver, FoundryListResolver, FoundryAgentConventionModule, FoundryAgentMode, FoundryRouteMap, InferAgentInput, InferAgentOutput
Instances, conversations & data
Guide: Definitions & instances
| Export | Kind | Purpose |
|---|---|---|
createAgentInstance | function | Instance record from a definition id string: (definitionId, { id?, workspaceId?, context?, installations?, playbooks? }). Defaults: id agent_<uuid>, workspace "default". |
defineAgentInstance | function | The same from an imported definition value — the code-authoring form for seeded instances. |
reconstructAgentInstance | function | Rehydrate a persisted instance into Foundry's frozen runtime shape (for custom data adapters). |
createConversation | function | Conversation record for an instance: (agent, { id?, title?, context?, workspaceId? }). See Conversations. |
MemoryFoundryDataAdapter | class | In-process FoundryDataAdapter; the default when the application sets no data. Private to each process and lost on restart. Seeds: agents, conversations, subscriptions, activations, environment. |
FileFoundryDataAdapter | class | Durable single-host adapter: one JSON file, advisory lock between processes (lockTimeoutMs 10 000, staleLockMs 30 000), atomic rename. Same seeds; inserted only when absent. |
toGloveMessage | function | Convert a FoundryMessageInput (string or content parts) into the native Glove user Message. |
toGloveRequestInput | function | Clone a FoundryMessageInput into the mutable input Glove.processRequest accepts. |
Types: AgentInstance, Conversation, CreateAgentInstanceOptions, UpdateAgentInstanceOptions, CreateConversationOptions, UpdateConversationOptions, EnvironmentValue, FoundryDataAdapter, FoundryActivationRecord, FoundryMessageInput, InboundDeliveryClaim, ProvisionAgentOptions, FoundryRequest, FoundryResult, FoundryTask, FoundryWorkingEnvironmentSnapshotOwner, SharedInboxItem, WorkspaceEntry, FileFoundryDataAdapterOptions
Composition & capabilities
Guide: Tools, MCP & memory
| Export | Kind | Purpose |
|---|---|---|
composeAgent | function | Merge 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_COMPOSITION | const | composeAgent() with nothing in it. |
defineSharedTool | function | Installable tool (*.tool.ts), optionally with a config schema. |
defineAgentApplication | function | Installable application (*.app.ts): inbound/outbound transmissions, connections, and an install Effect that contributes tools. Outbound transmissions become glove_app_*_send tools. |
defineApp | function | Alias of defineAgentApplication. |
defineMcp | function | Installable MCP server over HTTP or stdio (*.mcp.ts). |
defineMemory | function | Memory profile (*.memory.ts), mounted through the definition's memory field. |
configureMemory | function | Select a memory profile with typed config: configureMemory(profile, config). |
install | function | Installation data for an instance: install(definition, config?, { account? }) → AgentInstallation (kind is tool, application or mcp). |
installationKey | function | "<kind>:<id>" key used to de-duplicate installations (last write wins). |
defineLayer | function | Native surface (*.layer.ts) whose setup Effect mounts any Glove package on the assembled runnable. |
configureLayer | function | Select a layer with typed config: configureLayer(layer, config). |
defineSubscriber | function | Subscriber surface (*.subscriber.ts) receiving the run's Glove events. |
isFoundryCapability | function | True for shared tools, applications, MCP servers and memory profiles. |
isFoundryLayer, isFoundrySubscriber | function | Brand guards. |
isInboxCapableStore | function | True when a StoreAdapter implements getInboxItems, addInboxItem, updateInboxItem, getResolvedInboxItems (needed by inboxes and mesh). |
EMPTY_CAPABILITY_REGISTRY, EMPTY_NATIVE_REGISTRY | const | Empty 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
| Export | Kind | Purpose |
|---|---|---|
defineTransmission | function | Provider-neutral transport (*.transmission.ts) with inbound/outbound Effect schemas and adapters. |
defineTransmissionEvent | function | Named inbound or outbound event of a transmission (*.event.ts). |
defineTransmissionPredicate | function | Parameterized match predicate for playbooks (*.predicate.ts). |
transmissionPredicate | function | Find a predicate on a transmission's inbound contract: transmissionPredicate(transmission, id). |
isFoundryTransmission | function | Brand guard. |
serializeInboundTransmissionXml | function | Default XML rendering of an inbound event as the agent's user turn (used when the transmission has no serialize). |
defineConnection | function | Long-lived inbound connection (socket, poller) for an application (*.connection.ts); calls receive per event. |
defineAccount | function | Typed account reference for a transmission: id and metadata, never credentials. |
defineInboundRoute, defineOutboundRoute | function | Route records with typed per-transmission config. |
defineBinding | function | Bind an instance, application, transmission, account, route and capabilities into an AgentBinding. |
installedApplicationTransmissionToolName | function | Name of an installed app's generated outbound tool: glove_app_<app>__<transmission>_send. |
createInstalledApplicationTransmissionTools | function | Build those generated tools for an assembly context (the runtime does this). |
compileApplicationManifest | function | Compile transmissions into a credential-free manifest (Effect; fails with ManifestCompilationError). |
FoundryApplicationManifest, FoundryManifestCapability, FoundryManifestTransmission | Effect Schema | Manifest schemas (also exported as types). |
GrantResolver | Context tag | Effect service that resolves bindings into one run's RunGrant. |
grantResolverLive | Layer | Default GrantResolver. |
AccountDirectory, TopologyStore, EventStore | Context tag | Effect services for account metadata, routes/bindings and event payloads; replace them with the application's services layer. |
memoryAccountDirectory | function | In-memory AccountDirectory layer from a list of accounts. |
memoryTopologyStore, memoryEventStore | Layer | In-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
| Export | Kind | Purpose |
|---|---|---|
composePlaybook | function | Runtime playbook (match, directives, outbound routes) composed from imported transmission primitives; returned from the definition's playbooks field. |
definePlaybookAction | function | Named action a playbook directive references (*.action.ts). |
reconstructPlaybook | function | Rehydrate a stored playbook into the frozen runtime shape. |
definePlaybookSubscription | function | Durable subscription evaluated even when no instance exists (*.subscription.ts); provisions targets by policy: singleton, per-thread, per-event, existing, custom. |
reconstructPlaybookSubscription | function | Rehydrate 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
| Export | Kind | Purpose |
|---|---|---|
defineSchedule | function | Agent-local schedule { name, message, timing, payload?, enabled?, description? } returned from the schedules field. timing: at, after, every or cron (timezone default UTC). |
isFoundrySchedule | function | Brand guard. |
createFoundryCoreTools | function | Build the built-in glove_foundry_* tools for an assembly context. The runtime mounts them on every run. |
FOUNDRY_CORE_COMMAND_EVENT | const | "foundry.core.command" — the event type that carries tool-issued commands to the runtime. |
Types: DefineFoundryScheduleOptions, FoundryScheduleDefinition, FoundryScheduleTiming, FoundryScheduleTimingInput, FoundryCoreCommand
Working environment & REPL
Guide: Working environments
| Export | Kind | Purpose |
|---|---|---|
defineWorkingEnvironment | function | Sandboxed persistent VFS plus named scripts for the workingEnvironment field. |
defineRepl | function | One native JavaScript, Python or Lisp REPL for the repl field, with optional programmatic tool calling (programmaticTools, maxCalls default 50, max 1000). |
foundryDataEnvironmentPersistence | function | VFS persistence through the data adapter's private snapshot methods: foundryDataEnvironmentPersistence({ scope: "agent" | "conversation" }) (default agent). |
Types: DefineFoundryReplOptions, DefineFoundryWorkingEnvironmentOptions, FoundryJavaScriptReplDefinition, FoundryLispReplDefinition, FoundryMountedRepl, FoundryProgrammaticToolContext, FoundryProgrammaticToolSelection, FoundryProgrammaticTools, FoundryPythonReplDefinition, FoundryReplDefinition, FoundryVfs, FoundryVfsHandle, FoundryWorkingEnvironmentCreateContext, FoundryWorkingEnvironmentDefinition, FoundryWorkingEnvironmentPersistenceAdapter, FoundryWorkingEnvironmentPersistenceContext
Guidance
Guide: Goals, facts & forms
| Export | Kind | Purpose |
|---|---|---|
defineGoals, defineFacts, defineForms | function | Freeze options for the definition's goals, facts and forms fields. Pure values; no runtime state. |
foundryGuidanceSubject | function | Stable subject key for guidance state: foundryGuidanceSubject(ctx, "conversation" | "instance") (default conversation). |
Types: FoundryFactsOptions, FoundryGoalsOptions, FoundryFormsOptions, FoundryGuidanceHandles, FoundryGuidanceScope
Runtime, server & client
Guide: Client & HTTP API
| Export | Kind | Purpose |
|---|---|---|
defineApplication | function | Default export of foundry.application.ts: name plus optional data, conversationStore, accounts, routes, bindings, requestAuthorization, provisioner, services, daemon. |
isFoundryApplication | function | Brand guard. |
EMPTY_FOUNDRY_APPLICATION | const | defineApplication({ name: "Glove Foundry" }), used when there is no application file. |
FoundryRuntime | class | The control process: FoundryRuntime.discover({ rootDir, agentsDir, application?, applicationFilePath?, config? }), then start() / stop(). Owns data, activations, approvals and the execution daemon; every HTTP endpoint calls one of its methods. |
FoundryRuntimeError | tagged error class | Error of the runtime's Effect APIs (operation, message). |
FoundryServer | class | HTTP server for the inspector, /api, /v1 and /health: new FoundryServer(runtime, { host?, port?, branding?, messageBodyBytes? }), listen() → { host, port, url }, close(). |
createFoundryClient | function | Typed HTTP client; also exported by glove-foundry/client. Options: baseUrl (default http://127.0.0.1:4141), fetch, authorization. |
FoundryClient | class | The client class (see the method list below). |
FoundryRunHandle | class | Returned by send and agent(route).request: id, initial, get(), wait({ pollMs: 150, timeoutMs: 60_000 }), cancel(), steer(message), events(). |
discoverAgents | function | Import every agent file under agentsDir and return DiscoveredAgent[] ({ agentsDir, strictFileRoutes?, cacheBust? }). |
findAgentFiles | function | List agent files under a directory: agent.*, <route>/agent.*, <route>.agent.* (.ts, .tsx, .mts, .js, .mjs). |
routeFromAgentFile | function | Route for an agent file path, or null. A root agent.ts is the route default. |
createManifest | function | Build the FoundryManifest (per-agent tools, calls, schedules, lazy fields …). |
writeGeneratedTypes | function | Write .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
| Export | Kind | Purpose |
|---|---|---|
FoundryApprovalDisplayManager | class | Default display manager inside agent runs; turns a permission prompt into an expiring approval record and waits for the decision. |
withFoundryPermissions | function | Wrap a store that lacks getPermission/setPermission with a per-run, exact-input permission overlay. |
createFoundryApproval, listFoundryApprovals, resolveFoundryApproval | function | File-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
| Export | Kind | Purpose |
|---|---|---|
MemoryObservabilityAdapter | class | Default 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
| Export | Kind | Purpose |
|---|---|---|
defineConfig | function | Type-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
| Export | Kind | Purpose |
|---|---|---|
AccountId, AgentDefinitionId, AgentId, BindingId, CapabilityId, EventId, RouteId, RunId, TransmissionId | Effect Schema | Branded id schemas (each name is also its type). |
AccountReference, AccountSummary, AgentBinding, InboundRoute, OutboundRoute, Route, ReplyPolicy, RunGrant, EventReference | Effect Schema | Topology and grant records (each name is also its type). |
AccountNotFound, AccountSessionUnavailable, BindingNotFound, EventNotFound, GrantResolutionError, RouteNotFound, TopologyConflict | tagged error class | Domain errors; FoundryDomainError is their union. |
ManifestCompilationError | tagged error class | Raised by compileApplicationManifest. |
Types: FoundryDomainError
Advanced & internal
Guide: defineAgent & assembly
| Export | Kind | Purpose |
|---|---|---|
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_BRAND | symbol | Symbol.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_ENV | const | Names of the internal environment variables listed below. |
FOUNDRY_EVENT_PREFIX, FOUNDRY_EXECUTION_MARKER | const | "__GLOVE_FOUNDRY_EVENT__" (prefix of event lines a job writes to stdout) and "__glove_foundry_execution_v1" (marks a run's input envelope). |
internalAgentName, routeFromInternalAgentName | function | Route ↔ execution name: support/triage ↔ foundry_support__triage. |
installRegistry, mountAgentDefinitionMemory, mountFoundrySurfaces | function | The 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
| Export | Kind | Purpose |
|---|---|---|
stationDaemon | function | Configure 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 }. |
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.
import tseslint from "typescript-eslint";
import foundry from "glove-foundry/eslint";
export default [
{ ignores: [".foundry/**"] },
...tseslint.configs.recommended,
foundry,
];| Rule | Reports |
|---|---|
glove-foundry/no-agent-contracts | input/output passed to defineAgent or exported from an agent module. |
glove-foundry/no-file-definition-id | An id passed to a file-routed helper (defineAgent, defineSharedTool, defineApp, defineMcp, defineMemory, defineLayer, defineSubscriber, defineTransmission*, defineConnection, definePlaybookAction, definePlaybookSubscription, …). |
glove-foundry/no-raw-definition-references | String 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; no installation needed. Guides: Automation, Conversations, Multi-agent. Definitions with subagents also get Glove's glove_invoke_subagent; a mesh adds glove_mesh_send_message, glove_mesh_broadcast, glove_mesh_list_agents and glove_mesh_acknowledge; calls with exposeToAgent appear under their own names.
| Tool | Input | Effect |
|---|---|---|
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 authorized for this run. |
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_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.
| Methods | Endpoint |
|---|---|
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, { 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 |
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.
| Command | What 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 dev | Run 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 start | Run without file watching. |
glove foundry help | Print usage (also --help, -h). |
| Flag | Applies to | Meaning |
|---|---|---|
--template travel-concierge|minimal | init | Default travel-concierge. |
--target standalone|nextjs | init | Detected: a directory holding a Next.js app gets nextjs. |
--package-manager pnpm|npm|yarn|bun | init | Detected from lockfiles. |
--yes, --no-interactive | init | Accept defaults without prompts; installs only with --install. |
--interactive | init | Require a terminal; cannot combine with --yes. |
--install / --no-install | init | Install dependencies now, or print the command. |
--root <dir> | dev, start | Project root (default: current directory). |
--port <n>, --host <addr> | dev, start | Override server.port / server.host. |
--no-watch | dev | Disable 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
import { defineConfig } from "glove-foundry/config";
export default defineConfig({
server: { port: 4141 },
execution: { maxConcurrent: 10, maxAttempts: 2 },
branding: { name: "Acme Support", accent: "#0f766e" },
});| Key | Default | Notes |
|---|---|---|
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.port | 4141 | --port overrides it. |
server.messageBodyBytes | 1048576 (1 MB) | JSON limit for message-bearing endpoints; 1 MB to 128 MB. |
execution.maxConcurrent | 5 | Runs executing at once. |
execution.maxAttempts | 1 | Attempts per run. |
execution.retryBackoffMs | 1000 | Delay between attempts. |
execution.pollIntervalMs | 100 | Queue poll interval. |
execution.idlePollIntervalMs | 1000 | Deprecated; not forwarded to the Station 3 daemon. |
observability.maxEvents | 10000 | Events kept by the in-memory log. |
branding.name / label / descriptor / accent | "Glove Foundry" / — / "Inspector" / — | Inspector shell; accent is a six-digit hex colour. |
strictFileRoutes | true | Reject 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.
| Variable | Meaning |
|---|---|
.env, .env.local | Loaded from the project root by glove foundry dev / start (.env first). A variable that is already set is never overwritten. |
GLOVE_FOUNDRY_APPLICATION_FILE | Set 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_DIRECTORY | Set by the runtime: private directory for approval records. |
GLOVE_FOUNDRY_CORE_COMMAND_DIRECTORY | Set by the runtime: private directory for tool → runtime command requests (transmit calls). |
GLOVE_FOUNDRY_AGENT_ROUTE, GLOVE_FOUNDRY_AGENT_FILE | Read only by the legacy execution-agent entrypoint; the daemon passes agent identity explicitly. |
STATION_SIGNAL_RUN_ID | Set by Station in each job process; becomes ctx.runId ("unknown" if absent). |
npm_config_user_agent | Read by init to detect the package manager when there is no lockfile. |
NODE_OPTIONS, LD_PRELOAD, LD_LIBRARY_PATH, DYLD_INSERT_LIBRARIES | Removed from the environment of the execution daemon. |
FOUNDRY_URL | Not read by Foundry. The generated Next.js lib/foundry.ts uses it as the client baseUrl. |