Why warp-md is Agent-Friendly
warp-md provides a contract-first API designed for AI agents and programmatic workflows:Contract-First
Pydantic-validated schemas with deterministic outputs
Machine-Readable
JSON envelopes with structured error codes
CLI-Accessible
Any agent can invoke via subprocess
Streaming Support
NDJSON events for real-time progress
Agent Capabilities
| Capability | Tool | What Agents Can Do |
|---|---|---|
| Trajectory Analysis | warp-md | Calculate Rg, RMSD, RDF, conductivity (50+ analyses) |
| Molecular Packing | warp-pack | Solvate proteins, build simulation boxes |
| Peptide Building | warp-pep | Construct peptides, introduce mutations |
JSON Envelope Outputs
All tools return structured JSON envelopes for reliable parsing:Success Response
Error Response
The
exit_code field enables agents to distinguish error categories:0: Success2: Validation errors3: Analysis specification errors4: Runtime errors5: Internal errors
Structured Error Codes
All errors use machine-parseable codes for reliable recovery:| Code | Exit Code | Meaning | Recovery |
|---|---|---|---|
E_CONFIG_VALIDATION | 2 | Schema validation failed | Fix request schema |
E_CONFIG_VERSION | 2 | Unsupported schema version | Update schema version |
E_CONFIG_MISSING_FIELD | 2 | Required field missing | Add missing field |
E_ANALYSIS_UNKNOWN | 3 | Unknown analysis name | Check analysis list |
E_ANALYSIS_SPEC | 3 | Invalid analysis parameters | Add required parameters |
E_SELECTION_EMPTY | 3 | Mask matched no atoms | Fix selection syntax |
E_SELECTION_INVALID | 3 | Mask syntax error | Correct selection mask |
E_SYSTEM_LOAD | 4 | Failed to load topology | Verify file path/format |
E_TRAJECTORY_LOAD | 4 | Failed to load trajectory | Verify file path/format |
E_TRAJECTORY_EOF | 4 | Unexpected end of trajectory | Check trajectory file |
E_RUNTIME_EXEC | 4 | Analysis execution failed | Check input data |
E_OUTPUT_WRITE | 4 | Failed to write output | Check permissions |
E_DEVICE_UNAVAILABLE | 4 | Requested device not available | Use different device |
E_INTERNAL | 5 | Unexpected internal error | Report issue |
Quick Start
Agent Contract
All warp-md tools follow the same contract:- Structured input - JSON schemas with Pydantic validation
- Structured output - JSON envelope with status, timing, and results
- Error codes - Machine-parseable error types with context
- Streaming - NDJSON events for long-running operations
- Artifacts - File paths with checksums and metadata
The agent contract is versioned (
warp-md.agent.v1) to ensure backward compatibility as the API evolves.Common Agent Patterns
Pattern 1: Batch Analysis
Run multiple analyses on the same trajectory in a single request:Pattern 2: Pipeline (Pack → Analyze)
Chain tools together for complete workflows:Pattern 3: Iterative Design
Build, mutate, and analyze peptides:Next Steps
Schema Reference
Explore Pydantic schemas and the complete agent contract
Framework Integrations
Integration patterns for LangChain, CrewAI, AutoGen, and more