Skip to main content

Get Tool Metrics

Used to retrieve execution metrics for a specific tool. This provides insights into tool usage, performance, success rates, and other operational statistics.

API Endpoint

PropertyValue
Request MethodGET
Request URLhttps://api.seliseblocks.com/tools/{tool_id}/metrics

Request

Request Example

curl -X GET 'https://api.seliseblocks.com/tools/{tool_id}/metrics?project_key=YOUR_PROJECT_KEY' \
-H 'accept: application/json'

Path Parameters

FieldTypeRequiredDescription
tool_idstringYesThe unique identifier of the tool.

Query Parameters

FieldTypeRequiredDescription
project_keystringNoThe project key for your project.

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
note

Metrics Collection

  • Metrics are collected in real-time as the tool is used
  • Historical data is retained for analysis and reporting
  • Metrics include both successful and failed executions
  • Response times are measured end-to-end
  • Data is aggregated across all tool actions
tip

Use tool metrics for:

  • Monitoring tool performance and reliability
  • Identifying bottlenecks or slow actions
  • Tracking usage patterns and trends
  • Calculating success rates and error frequencies
  • Capacity planning and resource allocation
  • Troubleshooting integration issues
  • Generating usage reports and analytics

The metrics can help you:

  • Optimize tool configurations for better performance
  • Identify actions that need improvement
  • Understand peak usage times
  • Detect anomalies or unusual patterns
  • Make data-driven decisions about tool management

Response

Success Response (200 OK)

Returns comprehensive metrics for the tool.

{
"tool_id": "tool_123",
"tool_name": "Customer API",
"metrics_period": {
"start_date": "2025-12-01T00:00:00Z",
"end_date": "2026-01-12T23:59:59Z"
},
"execution_metrics": {
"total_executions": 15847,
"successful_executions": 15203,
"failed_executions": 644,
"success_rate": 95.93,
"average_response_time_ms": 342,
"median_response_time_ms": 287,
"p95_response_time_ms": 756,
"p99_response_time_ms": 1243,
"min_response_time_ms": 89,
"max_response_time_ms": 5421
},
"usage_statistics": {
"total_agents_using": 12,
"executions_last_24h": 458,
"executions_last_7d": 3214,
"executions_last_30d": 13876,
"peak_executions_per_hour": 127,
"average_executions_per_day": 462
},
"action_metrics": {
"get_customer": {
"executions": 8234,
"success_rate": 98.2,
"average_response_time_ms": 245
},
"create_customer": {
"executions": 3421,
"success_rate": 96.5,
"average_response_time_ms": 412
},
"update_customer": {
"executions": 2876,
"success_rate": 94.1,
"average_response_time_ms": 389
}
},
"error_breakdown": {
"timeout_errors": 234,
"authentication_errors": 89,
"rate_limit_errors": 156,
"server_errors": 98,
"validation_errors": 67
},
"rate_limiting": {
"total_rate_limited": 156,
"rate_limit_hit_rate": 0.98
},
"availability": {
"uptime_percentage": 99.87,
"downtime_incidents": 2,
"last_downtime": "2025-12-15T03:45:00Z"
},
"last_updated": "2026-01-12T07:38:09Z"
}

Response Fields

FieldTypeDescription
tool_idstringUnique identifier of the tool.
tool_namestringDisplay name of the tool.
metrics_periodobjectTime period covered by the metrics.
execution_metricsobjectDetailed execution statistics.
usage_statisticsobjectUsage patterns and trends.
action_metricsobjectPer-action performance metrics.
error_breakdownobjectBreakdown of errors by type.
rate_limitingobjectRate limiting statistics.
availabilityobjectUptime and availability metrics.
last_updatedstringISO 8601 timestamp when metrics were last updated.

Execution Metrics Fields

FieldTypeDescription
total_executionsintegerTotal number of tool executions.
successful_executionsintegerNumber of successful executions.
failed_executionsintegerNumber of failed executions.
success_ratenumberSuccess rate as a percentage.
average_response_time_msintegerAverage response time in milliseconds.
median_response_time_msintegerMedian response time in milliseconds.
p95_response_time_msinteger95th percentile response time in milliseconds.
p99_response_time_msinteger99th percentile response time in milliseconds.
min_response_time_msintegerMinimum response time in milliseconds.
max_response_time_msintegerMaximum response time in milliseconds.

Usage Statistics Fields

FieldTypeDescription
total_agents_usingintegerNumber of AI agents using this tool.
executions_last_24hintegerExecutions in the last 24 hours.
executions_last_7dintegerExecutions in the last 7 days.
executions_last_30dintegerExecutions in the last 30 days.
peak_executions_per_hourintegerHighest number of executions in any hour.
average_executions_per_dayintegerAverage executions per day.

Action Metrics Fields

Each action in action_metrics contains:

FieldTypeDescription
executionsintegerNumber of times this action was executed.
success_ratenumberSuccess rate for this action as a percentage.
average_response_time_msintegerAverage response time for this action in milliseconds.

Error Breakdown Fields

FieldTypeDescription
timeout_errorsintegerNumber of timeout errors.
authentication_errorsintegerNumber of authentication/authorization errors.
rate_limit_errorsintegerNumber of rate limit errors.
server_errorsintegerNumber of server-side errors (5xx).
validation_errorsintegerNumber of validation errors (invalid input).

Availability Fields

FieldTypeDescription
uptime_percentagenumberUptime as a percentage.
downtime_incidentsintegerNumber of downtime incidents.
last_downtimestringISO 8601 timestamp of last downtime incident.

Error Response (422 Unprocessable Entity)

Returns validation error details when the request parameters are invalid.

{
"detail": [
{
"loc": [
"path",
"tool_id"
],
"msg": "tool not found",
"type": "value_error.notfound"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., path, query).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid requestBad Request
404Not Found - Tool does not existNot Found
422Validation Error - Invalid request parametersUnprocessable Entity