> ## 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.

# エージェント: ツールコール評価

> POST /railscore/v1/agent/tool-call -- 実行前にツールコールを評価します。

<Info>
  **概念:** [エージェント評価](/concepts/agent-evaluation) | **Python:** [`client.agent.evaluate_tool_call()`](/sdk/python/agent-evaluation)
</Info>

## パラメータ

<ParamField body="tool_name" type="string" required>
  呼び出されるツールの名前。
</ParamField>

<ParamField body="tool_params" type="object" required>
  ツールに渡されるパラメータ。
</ParamField>

<ParamField body="agent_context" type="object">
  エージェントの役割と現在のタスク。オプションのフィールド: `goal` (string)、`prior_tool_calls` (オブジェクトの配列)、`agent_id` (string)、`turn_index` (integer)。
</ParamField>

<ParamField body="domain" type="string" default="general">
  評価を調整するためのドメインヒント (例: `finance`、`healthcare`)。
</ParamField>

<ParamField body="mode" type="string" default="basic">
  評価の深さ: `basic` または `deep`。
</ParamField>

<ParamField body="compliance_frameworks" type="string[]">
  コールをチェックするフレームワーク (例: `india_dpdp`、`gdpr`)。
</ParamField>

<ParamField body="custom_thresholds" type="object">
  判定閾値をオーバーライド。オプションのフィールド: `block_below` (数値 0-10)、`flag_below` (数値 0-10)、`dimension_minimums` (ディメンション → 最小スコアのオブジェクト)。
</ParamField>

## リクエスト

```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"}
  }'
```

## レスポンス

```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` 判定は HTTP 403 を返します。`ALLOW`/`FLAG` は 200 を返します。
</ResponseField>

<ResponseField name="decision_reason" type="string">
  判定の人間が読める説明。
</ResponseField>

<ResponseField name="rail_score" type="object">
  `score` (0-10)、`confidence` (0-1)、および `summary` 文字列。
</ResponseField>

<ResponseField name="suggested_params" type="object">
  エンジンが提案できるより安全なパラメータ値。提案できない場合は `null`。
</ResponseField>
