Agent endpoint implementation except JSON serialization