MCPcopy Create free account
hub / github.com/IBM/mcp-cli / ToolExecutionState

Class ToolExecutionState

src/mcp_cli/chat/models.py:237–254  ·  view source on GitHub ↗

State tracking for a tool currently being executed.

Source from the content-addressed store, hash-verified

235
236
237class ToolExecutionState(BaseModel):
238 """State tracking for a tool currently being executed."""
239
240 name: str = Field(description="Tool name")
241 arguments: dict[str, Any] = Field(
242 default_factory=dict, description="Tool arguments"
243 )
244 start_time: float = Field(description="Execution start time (timestamp)")
245 result: str | None = Field(default=None, description="Tool execution result")
246 success: bool = Field(default=True, description="Whether execution succeeded")
247 elapsed: float | None = Field(default=None, description="Elapsed time in seconds")
248 completed: bool = Field(default=False, description="Whether execution is complete")
249
250 model_config = {"frozen": False}
251
252 def elapsed_time(self, current_time: float) -> float:
253 """Calculate elapsed time from start."""
254 return current_time - self.start_time
255
256
257class ChatStatus(BaseModel):

Calls

no outgoing calls