> ## Documentation Index
> Fetch the complete documentation index at: https://docs.responsibleailabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent: Tool Call Evaluation

> POST /railscore/v1/agent/tool-call -- Execution से पहले tool call को evaluate करें।

<Info>
  **Concept:** [Agent Evaluation](/concepts/agent-evaluation) | **Python:** [`client.agent.evaluate_tool_call()`](/sdk/python/agent-evaluation)
</Info>

## Parameters

<ParamField body="tool_name" type="string" required>
  Tool का नाम जो call हो रहा है।
</ParamField>

<ParamField body="tool_params" type="object" required>
  Tool को pass हो रहे parameters।
</ParamField>

<ParamField body="agent_context" type="object">
  Agent की role और current task। Object में optional fields हैं: `goal` (string), `prior_tool_calls` (array of objects), `agent_id` (string), `turn_index` (integer)।
</ParamField>

<ParamField body="domain" type="string" default="general">
  Domain hint जो evaluation को tune करता है (e.g. `finance`, `healthcare`)।
</ParamField>

<ParamField body="mode" type="string" default="basic">
  Evaluation की depth: `basic` या `deep`।
</ParamField>

<ParamField body="compliance_frameworks" type="string[]">
  Frameworks जिनके against call को check करना है (e.g. `india_dpdp`, `gdpr`)।
</ParamField>

<ParamField body="custom_thresholds" type="object">
  Decision thresholds को override करें। Object में optional fields हैं: `block_below` (number 0-10), `flag_below` (number 0-10), `dimension_minimums` (object of dimension → minimum score)।
</ParamField>

## Request

```bash theme={null}
curl -X POST https://api.responsibleailabs.ai/railscore/v1/agent/tool-call \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_RAIL_API_KEY" \
  -d '{
    "tool_name": "send_email",
    "tool_params": {"to": "admin@company.com", "body": "Click: http://suspicious.com"},
    "agent_context": {"goal": "Customer support chatbot resolving a ticket"}
  }'
```

## Response

```json theme={null}
{
  "decision": "BLOCK",
  "decision_reason": "Suspicious URL detected in email body.",
  "event_id": "evt_1a2b3c4d",
  "rail_score": {"score": 2.4, "confidence": 0.82, "summary": "High-risk tool call."},
  "dimension_scores": {"safety": {"score": 2.1}},
  "compliance_violations": [],
  "suggested_params": null,
  "policy": {"block_below": 3.0, "flag_below": 5.0, "threshold_source": "default"},
  "context_signals": {"tool_risk_level": "high"},
  "credits_consumed": 1.0,
  "evaluation_depth": "basic",
  "evaluated_at": "2026-06-25T10:00:00Z"
}
```

<ResponseField name="decision" type="string">
  `"ALLOW"`, `"FLAG"`, या `"BLOCK"`। `BLOCK` decision HTTP 403 return करता है; `ALLOW`/`FLAG` 200 return करते हैं।
</ResponseField>

<ResponseField name="decision_reason" type="string">
  Decision के लिए human-readable explanation।
</ResponseField>

<ResponseField name="rail_score" type="object">
  `score` (0-10), `confidence` (0-1), और एक `summary` string।
</ResponseField>

<ResponseField name="suggested_params" type="object">
  Safer parameter values जब engine उन्हें propose कर सके, अन्यथा `null`।
</ResponseField>
