Documentation
Nity Agent
Tool Reference

Tool Reference

Nity exposes 12 tools across 5 registered tool groups. The 5 groups (nity_analyze, nity_execute, nity_quality_gate, nity_reflect, nity_skills) are the user-facing surface; each maps to one or more of the primitives documented here.


Execution Tools

autonomous_loop

Run iterative development with self-correction. The core of Nity's autonomous capability.

ParameterTypeRequiredDescription
taskstringThe task description to execute
maxIterationsnumberMaximum iteration count (default: 10)
exitStrategy"success" | "quality" | "manual"When to stop iterating

Returns: ToolResult with data: { iterations: number, outcome: string, episodes: Episode[] }

{
  "tool": "nity_execute",
  "params": {
    "task": "Add input validation to the login form",
    "maxIterations": 5,
    "exitStrategy": "quality"
  }
}

recommend_adapter

Get the best execution approach for a task.

ParameterTypeRequiredDescription
taskstringThe task to get an adapter recommendation for

Returns: ToolResult with data: ExecutionStrategy

{
  "tool": "nity_tools",
  "params": {
    "action": "recommend_adapter",
    "task": "Refactor database layer to use connection pooling"
  }
}

Brain & Memory Tools

load_brain

Retrieve the current session's brain context — accumulated memories, active skills, and project summary.

ParameterTypeRequiredDescription
(none)Uses current session context automatically

Returns: ToolResult with data: BrainContext

{
  "tool": "nity_analyze",
  "params": { "action": "load_brain" }
}

record_episode

Store a completed task outcome for future recall and learning.

ParameterTypeRequiredDescription
taskstringDescription of the completed task
outcome"success" | "failure" | "partial"Task outcome status
notesstringAdditional context or learnings

Returns: ToolResult with data: Episode

{
  "tool": "nity_reflect",
  "params": {
    "action": "record_episode",
    "task": "Implement rate limiting middleware",
    "outcome": "success",
    "notes": "Used token bucket algorithm, 100 req/min default"
  }
}

recall_episodes

Search for similar past tasks to inform current approach.

ParameterTypeRequiredDescription
querystringSearch query for similar episodes
limitnumberMax results to return (default: 5)

Returns: ToolResult with data: Episode[]

{
  "tool": "nity_reflect",
  "params": {
    "action": "recall_episodes",
    "query": "authentication middleware",
    "limit": 3
  }
}

Skill Tools

skill_find

Find relevant learned skills matching a query.

ParameterTypeRequiredDescription
querystringSearch query for skill matching

Returns: ToolResult with data: SkillEntry[]

{
  "tool": "nity_skills",
  "params": {
    "action": "find",
    "query": "database migration"
  }
}

skill_create

Register a new learned skill for future reuse.

ParameterTypeRequiredDescription
namestringHuman-readable skill name
triggerstringPattern that activates this skill
promptstringThe skill's instruction set

Returns: ToolResult with data: SkillEntry

⚠️

Skills are only created when NityConfig.skills.autoCreate is true and the self-reflection system determines the pattern is reusable. Direct skill_create calls bypass this gate — use sparingly.

{
  "tool": "nity_skills",
  "params": {
    "action": "create",
    "name": "FastAPI CRUD Generator",
    "trigger": "create CRUD endpoints for * model",
    "prompt": "Generate FastAPI CRUD routes with Pydantic schemas..."
  }
}

Analysis Tools

analyze_task

Decompose a task into subtasks with complexity scoring.

ParameterTypeRequiredDescription
taskstringThe task to decompose

Returns: ToolResult with data: TaskAnalysis

{
  "tool": "nity_analyze",
  "params": {
    "action": "analyze",
    "task": "Build a real-time dashboard with WebSocket support"
  }
}

Response includes:

  • subtasks[] — ordered list with dependency graph
  • complexitysimple | moderate | complex
  • estimatedIterations — total iteration estimate
  • requiredCapabilities — what the task needs (e.g., websocket, react, state-management)

validate_evidence

Check that a claim is supported by evidence. Used by quality gates.

ParameterTypeRequiredDescription
claimstringThe claim to validate
evidencestringSupporting evidence to check against the claim

Returns: ToolResult with data: { valid: boolean, confidence: number, gaps: string[] }

{
  "tool": "nity_quality_gate",
  "params": {
    "action": "validate_evidence",
    "claim": "All user inputs are sanitized before database queries",
    "evidence": "Uses parameterized queries in models/user.ts lines 45-78"
  }
}

Quality & Reflection Tools

quality_gate

Run a quality check against a specific dimension.

ParameterTypeRequiredDescription
dimensionstringQuality dimension to check (e.g., correctness, security, performance, style)

Returns: ToolResult with data: QualityDimension

The dimension parameter must match one of the configured dimensions in NityConfig.quality.dimensions. Default dimensions: correctness, security, performance, style.

{
  "tool": "nity_quality_gate",
  "params": {
    "dimension": "security"
  }
}

self_reflect

Trigger post-task reflection to extract learnings.

ParameterTypeRequiredDescription
taskstringThe task to reflect on

Returns: ToolResult with data: ReflectionRecord

{
  "tool": "nity_reflect",
  "params": {
    "action": "reflect",
    "task": "Optimize database query performance"
  }
}

Reflection produces:

  • Insights — categorized learnings (approach, quality, efficiency, gaps)
  • Confidence — how confident the reflection is in its findings
  • Applied skills — which skills were updated based on this reflection

evolve_strategy

Improve the execution approach based on accumulated evidence.

ParameterTypeRequiredDescription
focusAreastringArea to optimize (e.g., speed, quality, coverage)

Returns: ToolResult with data: { previous: ExecutionStrategy, updated: ExecutionStrategy, rationale: string }

evolve_strategy is typically called by the MetaLearner during periodic optimization cycles (controlled by NityConfig.meta.optimizeInterval). Manual invocation is useful after noticing systematic patterns.

{
  "tool": "nity_reflect",
  "params": {
    "action": "evolve_strategy",
    "focusArea": "speed"
  }
}

Tool Group Mapping

The 5 registered tool groups map to the 12 primitives:

Registered ToolPrimitives Exposed
nity_analyzeload_brain, analyze_task
nity_executeautonomous_loop, recommend_adapter
nity_quality_gatequality_gate, validate_evidence
nity_reflectrecord_episode, recall_episodes, self_reflect, evolve_strategy
nity_skillsskill_find, skill_create

Next Steps