OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Retrieves an agent by its ID.
Goal
View detailed agent configuration.
Context
Called when viewing agent details or editing.
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
import { AgentStatusEnum, ModelProviderEnum } from './agent.enum';
import { AgentCreatedEvent } from './agent.event';
import {
AgentSummaryModel,
AgentWithToolsModel,
CreateAgentInputModel,
UpdateAgentInputModel,
} from './agent.schema';
export const GetAgentQuery = defineQuery({
meta: {
key: 'agent-console.agent.get',
version: '1.0.0',
stability: 'stable',
owners: ['@agent-console-team'],
tags: ['agent', 'get'],
description: 'Retrieves an agent by its ID.',
goal: 'View detailed agent configuration.',
context: 'Called when viewing agent details or editing.',
},
io: {
input: defineSchemaModel({
name: 'GetAgentInput',
fields: {
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
includeTools: { type: ScalarTypeEnum.Boolean(), isOptional: true },
},
}),
output: AgentWithToolsModel,
errors: {
AGENT_NOT_FOUND: {
description: 'The specified agent does not exist',
http: 404,
gqlCode: 'AGENT_NOT_FOUND',
when: 'Agent ID is invalid',
},
},
},
policy: { auth: 'user' },
acceptance: {
scenarios: [
{
key: 'get-agent-happy-path',
given: ['Agent exists'],
when: ['User requests agent by ID'],
then: ['Agent details are returned'],
},
{
key: 'get-agent-with-tools',
given: ['Agent exists with assigned tools'],
when: ['User requests agent with includeTools=true'],
then: ['Agent details with tools list are returned'],
},
],
examples: [
{
key: 'get-basic',
input: { agentId: 'agent-123', includeTools: false },
output: {
id: 'agent-123',
name: 'Support Assistant',
status: 'active',
tools: [],
},
},
],
},
});