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

# Submit Rating

> Submit or update a tool rating

## Overview

Submit a star rating (1-5) for a tool with an optional comment. If you've already rated this tool, your existing rating is updated.

**Auth:** Requires authentication (JWT or API key).

## Body Parameters

<ParamField body="tool_id" type="string" required>
  The UUID of the tool to rate
</ParamField>

<ParamField body="rating" type="integer" required>
  Rating from 1 to 5
</ParamField>

<ParamField body="comment" type="string" default="">
  Optional text comment about the tool
</ParamField>

## Response

<ResponseField name="tool_id" type="string">
  The rated tool UUID
</ResponseField>

<ResponseField name="rating" type="integer">
  The submitted rating (1-5)
</ResponseField>

<ResponseField name="comment" type="string">
  The submitted comment
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.danubeai.com/v1/ratings" \
    -H "danube-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "tool_id": "tool_abc123",
      "rating": 5,
      "comment": "Works great, fast and reliable"
    }'
  ```

  ```python Python SDK theme={null}
  from danube import DanubeClient

  with DanubeClient(api_key="dk_...") as client:
      # Rating via SDK (if available)
      result = client.tools.rate(
          tool_id="tool_abc123",
          rating=5,
          comment="Works great, fast and reliable",
      )
  ```

  ```typescript TypeScript SDK theme={null}
  import { DanubeClient } from 'danube';

  const client = new DanubeClient({ apiKey: 'dk_...' });
  const result = await client.tools.rate({
    toolId: 'tool_abc123',
    rating: 5,
    comment: 'Works great, fast and reliable',
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "tool_id": "tool_abc123",
    "rating": 5,
    "comment": "Works great, fast and reliable",
    "created_at": "2026-02-24T12:00:00Z"
  }
  ```
</ResponseExample>

## MCP Tool

This endpoint is also available as the `submit_rating` MCP tool:

```python theme={null}
result = await mcp.call_tool("submit_rating", {
    "tool_id": "tool_abc123",
    "rating": 5,
    "comment": "Works great"
})
```
