Skip to main content
@guildai/agents-sdk is the TypeScript package that provides everything you need to build a Guild agent: agent constructors, tool sets, service interfaces, and platform utilities.
Ground truth for every export is the @guildai/agents-sdk package. See the SDK reference for full documentation.
The SDK is available only inside Guild’s agent runtime. You may not import external npm packages or Node.js built-in modules in agent code — only @guildai/agents-sdk, zod, and @guildai-services/* packages are supported.

Agent constructors

ExportDescription
llmAgentCreate a prompt-driven LLM agent
agentCreate a hand-coded agent with automatic or self-managed state
See LLM agents and Coded agents for usage.

Tool sets

ExportDescription
guildToolsPlatform tools (workspace context, credential requests, agent discovery, Guild service endpoints)
userInterfaceToolsUser interaction (prompt, notify, sleep)
consoleToolsDebug logging tools (mirrors of task.console)
noToolsEmpty tool set — useful as an explicit “this agent needs no tools” marker
Third-party service tools (for example gitHubTools) live in separate @guildai-services/* packages and are not re-exported from @guildai/agents-sdk. Import them alongside it.
See Tool sets for details on each tool set.

Utilities

ExportDescription
pickCherry-pick specific tools from a tool set
omitDrop specific tools from a tool set
outputReturn a final result from a SelfManagedStateAgent
callToolsReturn a tool call request from a SelfManagedStateAgent
askShortcut for callTools([...]) that asks the user a text prompt
progressLogNotifyEventConstruct a progress log event for task.ui.notify()
textPromptNotifyEventConstruct a text-prompt notification event
errorNotifyEventConstruct an error notification event
guildAgentToolCreate a custom tool that dispatches to another Guild agent
guildServiceToolCreate a custom tool wrapping a Guild service endpoint with a transformed output schema

Task object

The Task object passed to every agent’s run function provides access to platform services:
PropertyDescriptionAvailability
task.sessionIdOpaque session identifier used to correlate operationsAlways available
task.consoleDebug logging (debug, info, warn, error, log)Always available
task.toolsTyped proxy for all declared toolsAlways available
task.llmLLM calls via generateText()Always available
task.save / task.restorePersist and retrieve agent state between invocationsAlways available
task.guildPlatform operations (workspace context, credentials, service APIs)Requires guildTools
task.uiUser interaction and notificationsRequires userInterfaceTools
See Task object for the full API.