Skip to main content
guildai~get_self returns the calling agent’s own identity — agent details, running version, session context, and workspace — in a single idempotent call. No parameters are required; the runtime resolves identity automatically from execution context. The primary use case is attribution: call guildai_get_self just before posting to an external system — a pull request comment, Slack message, or Jira ticket — to attach accurate source information without threading identity details through prompts or agent inputs.
const self = await task.tools.guildai_get_self({})
guildai_get_self is automatically available to every running agent. No tool set import or credential configuration is required.

Response payload

FieldTypeDescription
agentobject | nullAgent details. Null when the session is running under the built-in assistant rather than a published agent.
versionobject | nullAgent version details. Null when the session is running under the built-in assistant.
sessionobjectCurrent session details.
workspaceobjectCurrent workspace details.

agent fields

FieldTypeDescription
idstringAgent ID.
namestringAgent name.
full_namestringAgent full name in owner~name format.
is_publicbooleanWhether the agent is publicly visible.
public_profile_urlstring | nullURL to the agent’s public profile page ({FRONTEND_URL}/hub/agents/{owner}~{name}). Null when the agent is private.
ownerobjectAgent owner. See owner fields.

version fields

FieldTypeDescription
idstringVersion ID.
statusstringPublication status: DRAFT, PUBLISHING, or PUBLISHED.
version_numberstring | nullVersion number. Null when status is DRAFT.

session fields

FieldTypeDescription
idstringSession ID.
session_typestringSession type: chat, agent_test, time, or webhook.
session_urlstringURL to the current session in the Guild UI.
workspace_urlstringURL to the current workspace in the Guild UI.

workspace fields

FieldTypeDescription
idstringWorkspace ID.
namestringWorkspace name.
full_namestringWorkspace full name in owner/workspace format.
ownerobjectWorkspace owner. See owner fields.

owner fields

Both agent.owner and workspace.owner share this shape.
FieldTypeDescription
idstringOwner ID.
typestringOwner type: user or organization.
namestringOwner name.

Attribution example

Call guildai_get_self once at the start of any run that will post to an external service, then reuse the result for each outbound action:
import { gitHubTools } from "@guildai-services/guildai~github"
import { slackTools } from "@guildai-services/guildai~slack"

// ...

const self = await task.tools.guildai_get_self({})

// Build a reusable attribution link
const attribution = self.agent
  ? `[${self.agent.full_name}](${self.session.session_url})`
  : `[Guild Assistant](${self.session.session_url})`

// Post a GitHub PR comment attributed to this agent
await task.tools.github_issues_create_comment({
  owner: "myorg",
  repo: "myrepo",
  issue_number: prNumber,
  body: `Review complete — posted by ${attribution}.`,
})

// Post a Slack message attributed to this agent
await task.tools.slack_chat_postMessage({
  channel: "#deploys",
  text: `Deploy triggered by ${attribution} in workspace \`${self.workspace.full_name}\`.`,
})
guildai_get_self is cheap and idempotent. Call it once per run and reuse the result across all external actions in the same agent invocation.