GetTaskResult

Type Alias GetTaskResult 

Source
pub type GetTaskResult = Task;
Expand description

Response from tasks/get containing current task status

This is a type alias - the response is a Task object with all current information.

Aliased Type§

pub struct GetTaskResult {
    pub task_id: String,
    pub status: TaskStatus,
    pub status_message: Option<String>,
    pub created_at: String,
    pub last_updated_at: String,
    pub ttl: Option<u64>,
    pub poll_interval: Option<u64>,
}

Fields§

§task_id: String

Unique identifier for this task

MUST be generated by receiver with cryptographic entropy (e.g., UUID v4). Task IDs are the primary access control mechanism.

§status: TaskStatus

Current task status

§status_message: Option<String>

Optional human-readable status message

Usage by status:

  • Cancelled: Reason for cancellation
  • Completed: Summary of results
  • Failed: Diagnostic info, error details
  • Working/InputRequired: Progress updates
§created_at: String

ISO 8601 timestamp when task was created

Format: YYYY-MM-DDTHH:MM:SSZ (UTC) TTL is measured from this timestamp.

§last_updated_at: String

ISO 8601 timestamp when task was last updated

Format: YYYY-MM-DDTHH:MM:SSZ (UTC) Updated whenever task status or other fields change.

§ttl: Option<u64>

Time-to-live in milliseconds from creation

  • Some(ms): Task expires after this duration from created_at
  • None: Unlimited retention (use with caution)

After expiry, receiver MAY delete task and results. Shorter TTLs improve security by reducing task ID exposure.

§poll_interval: Option<u64>

Suggested polling interval in milliseconds

Requestors SHOULD respect this value to avoid excessive polling. Receivers MAY adjust based on task complexity and load.