> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/api/ja/api-reference/gong-ju-he-lian-jie-qi.md).

# ツールとコネクタ

### ツールの作成 <a href="#tools-create" id="tools-create"></a>

POST `/api/v1/tools/`

#### リクエスト内容

**リクエストパラメータ**

| フィールド                        | 型                                                                                                                                                                                                                 | 必須  | 説明                                                                                                                                                                                                            |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                         | object                                                                                                                                                                                                            | いいえ | Tool name may only contain letters, digits, underscores (\_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM.                                                 |
| displayName                  | string                                                                                                                                                                                                            | はい  | A name with any characters, used by users for configuration and management.                                                                                                                                   |
| description                  | string                                                                                                                                                                                                            | いいえ | Tool description shown to users. Not required for MCP tools.                                                                                                                                                  |
| prompt                       | string                                                                                                                                                                                                            | いいえ | Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools.                                                                                                |
| toolType                     | string (enum: api, function, mcp, desktop, flex, quick\_reply, quick\_menu)                                                                                                                                       | いいえ | `api`: API ; `function`: Function ; `mcp`: MCP ; `desktop`: Desktop ; `flex`: Flex Message ; `quick_reply`: Quick Reply ; `quick_menu`: Quick Menu;                                                           |
| apiUrl                       | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| httpMethod                   | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| rawHeaders                   | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| sensitiveHeaders             | array\[string]                                                                                                                                                                                                    | いいえ |                                                                                                                                                                                                               |
| rawQueryParams               | object                                                                                                                                                                                                            | いいえ | Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw\_headers. On key collision with LLM-generated arguments, these values ...  |
| rawParametersSchema          | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| functionCode                 | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| mcpUrl                       | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| mcpRegistry                  | string (uuid)                                                                                                                                                                                                     | いいえ | Registry backing this MCP tool. Null for manual-URL MCP tools.                                                                                                                                                |
| mcpAllowedTools              | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| rawMcpHeader                 | object                                                                                                                                                                                                            | いいえ | Default headers used when the Contact has no matching MCP Credential.                                                                                                                                         |
| authSubject                  | object                                                                                                                                                                                                            | いいえ | Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per c...   |
| flexTemplateJson             | object                                                                                                                                                                                                            | いいえ | FlexMessage JSON template. Required for FLEX\_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.).                                          |
| flexSchema                   | object                                                                                                                                                                                                            | いいえ | AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex\_template\_json (e.g. text / image url / button label / button uri / button message). Each value may be e... |
| quickReplyConfig             | object                                                                                                                                                                                                            | いいえ | Authoring config for QUICK\_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt.                          |
| quickMenuConfig              | object                                                                                                                                                                                                            | いいえ | Authoring config for QUICK\_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a d...  |
| category                     | string (enum: knowledge\_base, web\_search, web\_fetch, code\_execution, file\_processing, image\_video\_generation, database\_query, third\_party\_integration, browser\_operation, agent\_collaboration, other) | いいえ | `knowledge_base`: Knowledge base retrieval ; `web_search`: Web search ; `web_fetch`: Web page fetch ; `code_execution`: Code execution ; `file_processing`: File processing ; `image_video_generation`: ...   |
| displayCopyByLocale          | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| outputRenderTemplateByLocale | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| toolDisplayMode              | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| groups                       | array\[IdName]                                                                                                                                                                                                    | いいえ | Groups this tool is assigned to. Non-owner members must pick at least one group they belong to.                                                                                                               |

**リクエスト構造の例**

```typescript
{
  "name"?: // 異なる型の場合があります (任意)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (任意)
  "displayName": string // A name with any characters, used by users for configuration and management.
  "description"?: string // Tool description shown to users. Not required for MCP tools. (任意)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (任意)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (任意)
  "apiUrl"?: string // 任意
  "httpMethod"?: // 異なる型の場合があります (任意)
  string (enum: get, post, put, delete, patch) // 任意
  "rawHeaders"?: object // 任意
  "sensitiveHeaders"?: [ // 任意
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (任意)
  "rawParametersSchema"?: object // 任意
  "functionCode"?: string // 任意
  "mcpUrl"?: string // 任意
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (任意)
  "mcpAllowedTools"?: object // 任意
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (任意)
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (任意)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (任意)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (任意)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (任意)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (任意)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "displayCopyByLocale"?: object // 任意
  "outputRenderTemplateByLocale"?: object // 任意
  "toolDisplayMode"?: // 異なる型の場合があります (任意)
  string (enum: full, compact, hidden) // 任意
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (任意)
    {
      "id": string (uuid)
    }
  ]
}
```

**リクエスト値の例**

```json
{
  "name": null,
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "prompt": "サンプル文字列",
  "toolType": "api",
  "apiUrl": "サンプル文字列",
  "httpMethod": null,
  "rawHeaders": null,
  "sensitiveHeaders": [
    "サンプル文字列"
  ],
  "rawQueryParams": null,
  "rawParametersSchema": null,
  "functionCode": "サンプル文字列",
  "mcpUrl": "サンプル文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": null,
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}
```

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しのサンプル (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/tools/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": null,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": null,
    "rawHeaders": null,
    "sensitiveHeaders": [
      "サンプル文字列"
    ],
    "rawQueryParams": null,
    "rawParametersSchema": null,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": null,
    "rawMcpHeader": null,
    "authSubject": {},
    "flexTemplateJson": null,
    "flexSchema": null,
    "quickReplyConfig": null,
    "quickMenuConfig": null,
    "category": "knowledge_base",
    "displayCopyByLocale": null,
    "outputRenderTemplateByLocale": null,
    "toolDisplayMode": null,
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": null,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": null,
    "rawHeaders": null,
    "sensitiveHeaders": [
      "サンプル文字列"
    ],
    "rawQueryParams": null,
    "rawParametersSchema": null,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": null,
    "rawMcpHeader": null,
    "authSubject": {},
    "flexTemplateJson": null,
    "flexSchema": null,
    "quickReplyConfig": null,
    "quickMenuConfig": null,
    "category": "knowledge_base",
    "displayCopyByLocale": null,
    "outputRenderTemplateByLocale": null,
    "toolDisplayMode": null,
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ]
  };

axios.post("https://api.maiagent.ai/api/v1/tools/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
    "name": None,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": None,
    "rawHeaders": None,
    "sensitiveHeaders": [
        "サンプル文字列"
    ],
    "rawQueryParams": None,
    "rawParametersSchema": None,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": None,
    "rawMcpHeader": None,
    "authSubject": {},
    "flexTemplateJson": None,
    "flexSchema": None,
    "quickReplyConfig": None,
    "quickMenuConfig": None,
    "category": "knowledge_base",
    "displayCopyByLocale": None,
    "outputRenderTemplateByLocale": None,
    "toolDisplayMode": None,
    "groups": [
        {
            "id": "550e8400-e29b-41d4-a716-446655440000"
        }
    ]
}

response = requests.post(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/tools/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => null,
            'displayName' => 'サンプル文字列',
            'description' => 'サンプル文字列',
            'prompt' => 'サンプル文字列',
            'toolType' => 'api',
            'apiUrl' => 'サンプル文字列',
            'httpMethod' => null,
            'rawHeaders' => null,
            'sensitiveHeaders' => [
                'サンプル文字列'
            ],
            'rawQueryParams' => null,
            'rawParametersSchema' => null,
            'functionCode' => 'サンプル文字列',
            'mcpUrl' => 'サンプル文字列',
            'mcpRegistry' => '550e8400-e29b-41d4-a716-446655440000',
            'mcpAllowedTools' => null,
            'rawMcpHeader' => null,
            'authSubject' => new \stdClass(),
            'flexTemplateJson' => null,
            'flexSchema' => null,
            'quickReplyConfig' => null,
            'quickMenuConfig' => null,
            'category' => 'knowledge_base',
            'displayCopyByLocale' => null,
            'outputRenderTemplateByLocale' => null,
            'toolDisplayMode' => null,
            'groups' => [
                [
                    'id' => '550e8400-e29b-41d4-a716-446655440000'
                ]
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 201**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name"?: // 異なる型の場合があります (任意)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (任意)
  "displayName": string // A name with any characters, used by users for configuration and management.
  "description"?: string // Tool description shown to users. Not required for MCP tools. (任意)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (任意)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (任意)
  "apiUrl"?: string // 任意
  "httpMethod"?: // 異なる型の場合があります (任意)
  string (enum: get, post, put, delete, patch) // 任意
  "rawHeaders"?: object // 任意
  "rawHeadersMasked": object
  "sensitiveHeaders"?: [ // 任意
    string
  ]
  "globalSensitiveHeaders": [ // Expose platform defaults as read-only authoring guidance.
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (任意)
  "rawQueryParamsMasked": object
  "rawParametersSchema"?: object // 任意
  "functionCode"?: string // 任意
  "organization": string (uuid)
  "createdBy": string (uuid)
  "isGlobal": boolean // If set as global tool, all organizations can use this tool
  "mcpUrl"?: string // 任意
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (任意)
  "mcpAllowedTools"?: object // 任意
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (任意)
  "rawMcpHeaderMasked": object
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (任意)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (任意)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (任意)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (任意)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (任意)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "displayCopyByLocale"?: object // 任意
  "outputRenderTemplateByLocale"?: object // 任意
  "toolDisplayMode"?: // 異なる型の場合があります (任意)
  string (enum: full, compact, hidden) // 任意
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (任意)
    {
      "id": string (uuid)
      "name": string
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "canUpdate": boolean // Return whether the current user can update this resource.
  "canDelete": boolean // Return whether the current user can delete this resource.
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "prompt": "レスポンス文字列",
  "toolType": "api",
  "apiUrl": "レスポンス文字列",
  "httpMethod": "get",
  "rawHeaders": null,
  "rawHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "sensitiveHeaders": [
    "レスポンス文字列"
  ],
  "globalSensitiveHeaders": [
    "レスポンス文字列"
  ],
  "rawQueryParams": null,
  "rawQueryParamsMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "rawParametersSchema": null,
  "functionCode": "レスポンス文字列",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "isGlobal": false,
  "mcpUrl": "レスポンス文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "rawMcpHeaderMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": "full",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "canUpdate": false,
  "canDelete": false
}
```

***

### ツールの一覧取得 <a href="#tools-list" id="tools-list"></a>

GET `/api/v1/tools/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                                                                                      |
| ---------------- | -- | ------- | ------------------------------------------------------------------------------------------------------- |
| `clientPlatform` | ❌  | string  | 呼び出し元のプラットフォームです。"desktop" を指定すると desktop タイプのツールが含まれます。それ以外の値を指定した場合や未指定の場合は、デフォルトで desktop ツールが除外されます |
| `isGlobal`       | ❌  | boolean | "true" を指定するとグローバルツールを取得し、指定しない場合は組織のツールを取得します                                                          |
| `page`           | ❌  | integer | A page number within the paginated result set.                                                          |
| `pageSize`       | ❌  | integer | Number of results to return per page.                                                                   |
| `toolType`       | ❌  | string  | ツールタイプで絞り込みます：api, function, mcp, desktop                                                               |

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しのサンプル (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tools/?clientPlatform=desktop&isGlobal=true&page=1&pageSize=1&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tools/?clientPlatform=desktop&isGlobal=true&page=1&pageSize=1&toolType=api", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/?clientPlatform=desktop&isGlobal=true&page=1&pageSize=1&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tools/?clientPlatform=desktop&isGlobal=true&page=1&pageSize=1&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 省略可能
  "previous"?: string (uri) // 省略可能
  "results": [
    {
      "id": string (uuid)
      "name"?: // 複数の型を取り得ます (省略可能)
      string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (省略可能)
      "displayName": string // A name with any characters, used by users for configuration and management.
      "description"?: string // Tool description shown to users. Not required for MCP tools. (省略可能)
      "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (省略可能)
      "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (省略可能)
      "apiUrl"?: string // 省略可能
      "httpMethod"?: // 複数の型を取り得ます (省略可能)
      string (enum: get, post, put, delete, patch) // 省略可能
      "rawHeaders"?: object // 省略可能
      "rawHeadersMasked": object
      "sensitiveHeaders"?: [ // 省略可能
        string
      ]
      "globalSensitiveHeaders": [ // Expose platform defaults as read-only authoring guidance.
        string
      ]
      "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (省略可能)
      "rawQueryParamsMasked": object
      "rawParametersSchema"?: object // 省略可能
      "functionCode"?: string // 省略可能
      "organization": string (uuid)
      "createdBy": string (uuid)
      "isGlobal": boolean // If set as global tool, all organizations can use this tool
      "mcpUrl"?: string // 省略可能
      "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (省略可能)
      "mcpAllowedTools"?: object // 省略可能
      "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (省略可能)
      "rawMcpHeaderMasked": object
      "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (省略可能)
      {
      }
      "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (省略可能)
      "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (省略可能)
      "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (省略可能)
      "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (省略可能)
      "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (省略可能)
      "displayCopyByLocale"?: object // 省略可能
      "outputRenderTemplateByLocale"?: object // 省略可能
      "toolDisplayMode"?: // 複数の型を取り得ます (省略可能)
      string (enum: full, compact, hidden) // 省略可能
      "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (省略可能)
        {
          "id": string (uuid)
          "name": string
        }
      ]
      "createdAt": string (timestamp)
      "updatedAt": string (timestamp)
      "canUpdate": boolean // Return whether the current user can update this resource.
      "canDelete": boolean // Return whether the current user can delete this resource.
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "displayName": "レスポンス文字列",
      "description": "レスポンス文字列",
      "prompt": "レスポンス文字列",
      "toolType": "api",
      "apiUrl": "レスポンス文字列",
      "httpMethod": "get",
      "rawHeaders": null,
      "rawHeadersMasked": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "sensitiveHeaders": [
        "レスポンス文字列"
      ],
      "globalSensitiveHeaders": [
        "レスポンス文字列"
      ],
      "rawQueryParams": null,
      "rawQueryParamsMasked": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "rawParametersSchema": null,
      "functionCode": "レスポンス文字列",
      "organization": "550e8400-e29b-41d4-a716-446655440000",
      "createdBy": "550e8400-e29b-41d4-a716-446655440000",
      "isGlobal": false,
      "mcpUrl": "レスポンス文字列",
      "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
      "mcpAllowedTools": null,
      "rawMcpHeader": null,
      "rawMcpHeaderMasked": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "authSubject": {},
      "flexTemplateJson": null,
      "flexSchema": null,
      "quickReplyConfig": null,
      "quickMenuConfig": null,
      "category": "knowledge_base",
      "displayCopyByLocale": null,
      "outputRenderTemplateByLocale": null,
      "toolDisplayMode": "full",
      "groups": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列"
        }
      ],
      "createdAt": "レスポンス文字列",
      "updatedAt": "レスポンス文字列",
      "canUpdate": false,
      "canDelete": false
    }
  ]
}
```

***

### 特定のツールを取得 <a href="#tools-retrieve" id="tools-retrieve"></a>

GET `/api/v1/tools/{id}/`

#### パラメーター

| パラメーター名 | 必須 | 型      | 説明                                   |
| ------- | -- | ------ | ------------------------------------ |
| `id`    | ✅  | string | A UUID string identifying this Tool. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name"?: // 複数の型を取り得ます (省略可能)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (省略可能)
  "displayName": string // A name with any characters, used by users for configuration and management.
  "description"?: string // Tool description shown to users. Not required for MCP tools. (省略可能)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (省略可能)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (省略可能)
  "apiUrl"?: string // 省略可能
  "httpMethod"?: // 複数の型を取り得ます (省略可能)
  string (enum: get, post, put, delete, patch) // 省略可能
  "rawHeaders"?: object // 省略可能
  "rawHeadersMasked": object
  "sensitiveHeaders"?: [ // 省略可能
    string
  ]
  "globalSensitiveHeaders": [ // Expose platform defaults as read-only authoring guidance.
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (省略可能)
  "rawQueryParamsMasked": object
  "rawParametersSchema"?: object // 省略可能
  "functionCode"?: string // 省略可能
  "organization": string (uuid)
  "createdBy": string (uuid)
  "isGlobal": boolean // If set as global tool, all organizations can use this tool
  "mcpUrl"?: string // 省略可能
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (省略可能)
  "mcpAllowedTools"?: object // 省略可能
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (省略可能)
  "rawMcpHeaderMasked": object
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (省略可能)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (省略可能)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (省略可能)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (省略可能)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (省略可能)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (省略可能)
  "displayCopyByLocale"?: object // 省略可能
  "outputRenderTemplateByLocale"?: object // 省略可能
  "toolDisplayMode"?: // 複数の型を取り得ます (省略可能)
  string (enum: full, compact, hidden) // 省略可能
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (省略可能)
    {
      "id": string (uuid)
      "name": string
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "canUpdate": boolean // Return whether the current user can update this resource.
  "canDelete": boolean // Return whether the current user can delete this resource.
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "prompt": "レスポンス文字列",
  "toolType": "api",
  "apiUrl": "レスポンス文字列",
  "httpMethod": "get",
  "rawHeaders": null,
  "rawHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "sensitiveHeaders": [
    "レスポンス文字列"
  ],
  "globalSensitiveHeaders": [
    "レスポンス文字列"
  ],
  "rawQueryParams": null,
  "rawQueryParamsMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "rawParametersSchema": null,
  "functionCode": "レスポンス文字列",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "isGlobal": false,
  "mcpUrl": "レスポンス文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "rawMcpHeaderMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": "full",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "canUpdate": false,
  "canDelete": false
}
```

***

### ツールを更新 <a href="#tools-update" id="tools-update"></a>

PUT `/api/v1/tools/{id}/`

#### パラメーター

| パラメーター名 | 必須 | 型      | 説明                                   |
| ------- | -- | ------ | ------------------------------------ |
| `id`    | ✅  | string | A UUID string identifying this Tool. |

#### リクエスト内容

**リクエストパラメータ**

| フィールド                        | 型                                                                                                                                                                                                                 | 必須  | 説明                                                                                                                                                                                                            |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                         | object                                                                                                                                                                                                            | いいえ | Tool name may only contain letters, digits, underscores (\_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM.                                                 |
| displayName                  | string                                                                                                                                                                                                            | はい  | A name with any characters, used by users for configuration and management.                                                                                                                                   |
| description                  | string                                                                                                                                                                                                            | いいえ | Tool description shown to users. Not required for MCP tools.                                                                                                                                                  |
| prompt                       | string                                                                                                                                                                                                            | いいえ | Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools.                                                                                                |
| toolType                     | string (enum: api, function, mcp, desktop, flex, quick\_reply, quick\_menu)                                                                                                                                       | いいえ | `api`: API ; `function`: Function ; `mcp`: MCP ; `desktop`: Desktop ; `flex`: Flex Message ; `quick_reply`: Quick Reply ; `quick_menu`: Quick Menu;                                                           |
| apiUrl                       | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| httpMethod                   | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| rawHeaders                   | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| sensitiveHeaders             | array\[string]                                                                                                                                                                                                    | いいえ |                                                                                                                                                                                                               |
| rawQueryParams               | object                                                                                                                                                                                                            | いいえ | Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw\_headers. On key collision with LLM-generated arguments, these values ...  |
| rawParametersSchema          | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| functionCode                 | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| mcpUrl                       | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| mcpRegistry                  | string (uuid)                                                                                                                                                                                                     | いいえ | Registry backing this MCP tool. Null for manual-URL MCP tools.                                                                                                                                                |
| mcpAllowedTools              | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| rawMcpHeader                 | object                                                                                                                                                                                                            | いいえ | Default headers used when the Contact has no matching MCP Credential.                                                                                                                                         |
| authSubject                  | object                                                                                                                                                                                                            | いいえ | Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per c...   |
| flexTemplateJson             | object                                                                                                                                                                                                            | いいえ | FlexMessage JSON template. Required for FLEX\_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.).                                          |
| flexSchema                   | object                                                                                                                                                                                                            | いいえ | AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex\_template\_json (e.g. text / image url / button label / button uri / button message). Each value may be e... |
| quickReplyConfig             | object                                                                                                                                                                                                            | いいえ | Authoring config for QUICK\_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt.                          |
| quickMenuConfig              | object                                                                                                                                                                                                            | いいえ | Authoring config for QUICK\_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a d...  |
| category                     | string (enum: knowledge\_base, web\_search, web\_fetch, code\_execution, file\_processing, image\_video\_generation, database\_query, third\_party\_integration, browser\_operation, agent\_collaboration, other) | いいえ | `knowledge_base`: Knowledge base retrieval ; `web_search`: Web search ; `web_fetch`: Web page fetch ; `code_execution`: Code execution ; `file_processing`: File processing ; `image_video_generation`: ...   |
| displayCopyByLocale          | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| outputRenderTemplateByLocale | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| toolDisplayMode              | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| groups                       | array\[IdName]                                                                                                                                                                                                    | いいえ | Groups this tool is assigned to. Non-owner members must pick at least one group they belong to.                                                                                                               |

**リクエストスキーマの例**

```typescript
{
  "name"?: // 異なる型の場合があります (任意)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (任意)
  "displayName": string // A name with any characters, used by users for configuration and management.
  "description"?: string // Tool description shown to users. Not required for MCP tools. (任意)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (任意)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (任意)
  "apiUrl"?: string // 任意
  "httpMethod"?: // 異なる型の場合があります (任意)
  string (enum: get, post, put, delete, patch) // 任意
  "rawHeaders"?: object // 任意
  "sensitiveHeaders"?: [ // 任意
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (任意)
  "rawParametersSchema"?: object // 任意
  "functionCode"?: string // 任意
  "mcpUrl"?: string // 任意
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (任意)
  "mcpAllowedTools"?: object // 任意
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (任意)
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (任意)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (任意)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (任意)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (任意)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (任意)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "displayCopyByLocale"?: object // 任意
  "outputRenderTemplateByLocale"?: object // 任意
  "toolDisplayMode"?: // 異なる型の場合があります (任意)
  string (enum: full, compact, hidden) // 任意
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (任意)
    {
      "id": string (uuid)
    }
  ]
}
```

**リクエスト値の例**

```json
{
  "name": null,
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "prompt": "サンプル文字列",
  "toolType": "api",
  "apiUrl": "サンプル文字列",
  "httpMethod": null,
  "rawHeaders": null,
  "sensitiveHeaders": [
    "サンプル文字列"
  ],
  "rawQueryParams": null,
  "rawParametersSchema": null,
  "functionCode": "サンプル文字列",
  "mcpUrl": "サンプル文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": null,
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}
```

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しのサンプル (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": null,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": null,
    "rawHeaders": null,
    "sensitiveHeaders": [
      "サンプル文字列"
    ],
    "rawQueryParams": null,
    "rawParametersSchema": null,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": null,
    "rawMcpHeader": null,
    "authSubject": {},
    "flexTemplateJson": null,
    "flexSchema": null,
    "quickReplyConfig": null,
    "quickMenuConfig": null,
    "category": "knowledge_base",
    "displayCopyByLocale": null,
    "outputRenderTemplateByLocale": null,
    "toolDisplayMode": null,
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": null,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": null,
    "rawHeaders": null,
    "sensitiveHeaders": [
      "サンプル文字列"
    ],
    "rawQueryParams": null,
    "rawParametersSchema": null,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": null,
    "rawMcpHeader": null,
    "authSubject": {},
    "flexTemplateJson": null,
    "flexSchema": null,
    "quickReplyConfig": null,
    "quickMenuConfig": null,
    "category": "knowledge_base",
    "displayCopyByLocale": null,
    "outputRenderTemplateByLocale": null,
    "toolDisplayMode": null,
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ]
  };

axios.put("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
    "name": None,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": None,
    "rawHeaders": None,
    "sensitiveHeaders": [
        "サンプル文字列"
    ],
    "rawQueryParams": None,
    "rawParametersSchema": None,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": None,
    "rawMcpHeader": None,
    "authSubject": {},
    "flexTemplateJson": None,
    "flexSchema": None,
    "quickReplyConfig": None,
    "quickMenuConfig": None,
    "category": "knowledge_base",
    "displayCopyByLocale": None,
    "outputRenderTemplateByLocale": None,
    "toolDisplayMode": None,
    "groups": [
        {
            "id": "550e8400-e29b-41d4-a716-446655440000"
        }
    ]
}

response = requests.put(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => null,
            'displayName' => 'サンプル文字列',
            'description' => 'サンプル文字列',
            'prompt' => 'サンプル文字列',
            'toolType' => 'api',
            'apiUrl' => 'サンプル文字列',
            'httpMethod' => null,
            'rawHeaders' => null,
            'sensitiveHeaders' => [
                'サンプル文字列'
            ],
            'rawQueryParams' => null,
            'rawParametersSchema' => null,
            'functionCode' => 'サンプル文字列',
            'mcpUrl' => 'サンプル文字列',
            'mcpRegistry' => '550e8400-e29b-41d4-a716-446655440000',
            'mcpAllowedTools' => null,
            'rawMcpHeader' => null,
            'authSubject' => new \stdClass(),
            'flexTemplateJson' => null,
            'flexSchema' => null,
            'quickReplyConfig' => null,
            'quickMenuConfig' => null,
            'category' => 'knowledge_base',
            'displayCopyByLocale' => null,
            'outputRenderTemplateByLocale' => null,
            'toolDisplayMode' => null,
            'groups' => [
                [
                    'id' => '550e8400-e29b-41d4-a716-446655440000'
                ]
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name"?: // 異なる型の場合があります (任意)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (任意)
  "displayName": string // A name with any characters, used by users for configuration and management.
  "description"?: string // Tool description shown to users. Not required for MCP tools. (任意)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (任意)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (任意)
  "apiUrl"?: string // 任意
  "httpMethod"?: // 異なる型の場合があります (任意)
  string (enum: get, post, put, delete, patch) // 任意
  "rawHeaders"?: object // 任意
  "rawHeadersMasked": object
  "sensitiveHeaders"?: [ // 任意
    string
  ]
  "globalSensitiveHeaders": [ // Expose platform defaults as read-only authoring guidance.
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (任意)
  "rawQueryParamsMasked": object
  "rawParametersSchema"?: object // 任意
  "functionCode"?: string // 任意
  "organization": string (uuid)
  "createdBy": string (uuid)
  "isGlobal": boolean // If set as global tool, all organizations can use this tool
  "mcpUrl"?: string // 任意
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (任意)
  "mcpAllowedTools"?: object // 任意
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (任意)
  "rawMcpHeaderMasked": object
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (任意)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (任意)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (任意)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (任意)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (任意)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "displayCopyByLocale"?: object // 任意
  "outputRenderTemplateByLocale"?: object // 任意
  "toolDisplayMode"?: // 異なる型の場合があります (任意)
  string (enum: full, compact, hidden) // 任意
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (任意)
    {
      "id": string (uuid)
      "name": string
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "canUpdate": boolean // Return whether the current user can update this resource.
  "canDelete": boolean // Return whether the current user can delete this resource.
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "prompt": "レスポンス文字列",
  "toolType": "api",
  "apiUrl": "レスポンス文字列",
  "httpMethod": "get",
  "rawHeaders": null,
  "rawHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "sensitiveHeaders": [
    "レスポンス文字列"
  ],
  "globalSensitiveHeaders": [
    "レスポンス文字列"
  ],
  "rawQueryParams": null,
  "rawQueryParamsMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "rawParametersSchema": null,
  "functionCode": "レスポンス文字列",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "isGlobal": false,
  "mcpUrl": "レスポンス文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "rawMcpHeaderMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": "full",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "canUpdate": false,
  "canDelete": false
}
```

***

### ツールの一部を更新 <a href="#tools-partial-update" id="tools-partial-update"></a>

PATCH `/api/v1/tools/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                   |
| ------ | -- | ------ | ------------------------------------ |
| `id`   | ✅  | string | A UUID string identifying this Tool. |

#### リクエスト内容

**リクエストパラメータ**

| フィールド                        | 型                                                                                                                                                                                                                 | 必須  | 説明                                                                                                                                                                                                            |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                         | object                                                                                                                                                                                                            | いいえ | Tool name may only contain letters, digits, underscores (\_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM.                                                 |
| displayName                  | string                                                                                                                                                                                                            | いいえ | A name with any characters, used by users for configuration and management.                                                                                                                                   |
| description                  | string                                                                                                                                                                                                            | いいえ | Tool description shown to users. Not required for MCP tools.                                                                                                                                                  |
| prompt                       | string                                                                                                                                                                                                            | いいえ | Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools.                                                                                                |
| toolType                     | string (enum: api, function, mcp, desktop, flex, quick\_reply, quick\_menu)                                                                                                                                       | いいえ | `api`: API ; `function`: Function ; `mcp`: MCP ; `desktop`: Desktop ; `flex`: Flex Message ; `quick_reply`: Quick Reply ; `quick_menu`: Quick Menu;                                                           |
| apiUrl                       | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| httpMethod                   | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| rawHeaders                   | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| sensitiveHeaders             | array\[string]                                                                                                                                                                                                    | いいえ |                                                                                                                                                                                                               |
| rawQueryParams               | object                                                                                                                                                                                                            | いいえ | Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw\_headers. On key collision with LLM-generated arguments, these values ...  |
| rawParametersSchema          | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| functionCode                 | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| mcpUrl                       | string                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| mcpRegistry                  | string (uuid)                                                                                                                                                                                                     | いいえ | Registry backing this MCP tool. Null for manual-URL MCP tools.                                                                                                                                                |
| mcpAllowedTools              | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| rawMcpHeader                 | object                                                                                                                                                                                                            | いいえ | Default headers used when the Contact has no matching MCP Credential.                                                                                                                                         |
| authSubject                  | object                                                                                                                                                                                                            | いいえ | Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per c...   |
| flexTemplateJson             | object                                                                                                                                                                                                            | いいえ | FlexMessage JSON template. Required for FLEX\_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.).                                          |
| flexSchema                   | object                                                                                                                                                                                                            | いいえ | AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex\_template\_json (e.g. text / image url / button label / button uri / button message). Each value may be e... |
| quickReplyConfig             | object                                                                                                                                                                                                            | いいえ | Authoring config for QUICK\_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt.                          |
| quickMenuConfig              | object                                                                                                                                                                                                            | いいえ | Authoring config for QUICK\_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a d...  |
| category                     | string (enum: knowledge\_base, web\_search, web\_fetch, code\_execution, file\_processing, image\_video\_generation, database\_query, third\_party\_integration, browser\_operation, agent\_collaboration, other) | いいえ | `knowledge_base`: Knowledge base retrieval ; `web_search`: Web search ; `web_fetch`: Web page fetch ; `code_execution`: Code execution ; `file_processing`: File processing ; `image_video_generation`: ...   |
| displayCopyByLocale          | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| outputRenderTemplateByLocale | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| toolDisplayMode              | object                                                                                                                                                                                                            | いいえ |                                                                                                                                                                                                               |
| groups                       | array\[IdName]                                                                                                                                                                                                    | いいえ | Groups this tool is assigned to. Non-owner members must pick at least one group they belong to.                                                                                                               |

**リクエスト構造の例**

```typescript
{
  "name"?: // 異なる型の場合があります (任意)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (任意)
  "displayName"?: string // A name with any characters, used by users for configuration and management. (任意)
  "description"?: string // Tool description shown to users. Not required for MCP tools. (任意)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (任意)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (任意)
  "apiUrl"?: string // 任意
  "httpMethod"?: // 異なる型の場合があります (任意)
  string (enum: get, post, put, delete, patch) // 任意
  "rawHeaders"?: object // 任意
  "sensitiveHeaders"?: [ // 任意
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (任意)
  "rawParametersSchema"?: object // 任意
  "functionCode"?: string // 任意
  "mcpUrl"?: string // 任意
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (任意)
  "mcpAllowedTools"?: object // 任意
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (任意)
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (任意)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (任意)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (任意)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (任意)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (任意)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "displayCopyByLocale"?: object // 任意
  "outputRenderTemplateByLocale"?: object // 任意
  "toolDisplayMode"?: // 異なる型の場合があります (任意)
  string (enum: full, compact, hidden) // 任意
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (任意)
    {
      "id": string (uuid)
    }
  ]
}
```

**リクエスト値の例**

```json
{
  "name": null,
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "prompt": "サンプル文字列",
  "toolType": "api",
  "apiUrl": "サンプル文字列",
  "httpMethod": null,
  "rawHeaders": null,
  "sensitiveHeaders": [
    "サンプル文字列"
  ],
  "rawQueryParams": null,
  "rawParametersSchema": null,
  "functionCode": "サンプル文字列",
  "mcpUrl": "サンプル文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": null,
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}
```

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しのサンプル (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": null,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": null,
    "rawHeaders": null,
    "sensitiveHeaders": [
      "サンプル文字列"
    ],
    "rawQueryParams": null,
    "rawParametersSchema": null,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": null,
    "rawMcpHeader": null,
    "authSubject": {},
    "flexTemplateJson": null,
    "flexSchema": null,
    "quickReplyConfig": null,
    "quickMenuConfig": null,
    "category": "knowledge_base",
    "displayCopyByLocale": null,
    "outputRenderTemplateByLocale": null,
    "toolDisplayMode": null,
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ]
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト内容 (payload)
const data = {
    "name": null,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": null,
    "rawHeaders": null,
    "sensitiveHeaders": [
      "サンプル文字列"
    ],
    "rawQueryParams": null,
    "rawParametersSchema": null,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": null,
    "rawMcpHeader": null,
    "authSubject": {},
    "flexTemplateJson": null,
    "flexSchema": null,
    "quickReplyConfig": null,
    "quickMenuConfig": null,
    "category": "knowledge_base",
    "displayCopyByLocale": null,
    "outputRenderTemplateByLocale": null,
    "toolDisplayMode": null,
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ]
  };

axios.patch("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
    "name": None,
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "prompt": "サンプル文字列",
    "toolType": "api",
    "apiUrl": "サンプル文字列",
    "httpMethod": None,
    "rawHeaders": None,
    "sensitiveHeaders": [
        "サンプル文字列"
    ],
    "rawQueryParams": None,
    "rawParametersSchema": None,
    "functionCode": "サンプル文字列",
    "mcpUrl": "サンプル文字列",
    "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
    "mcpAllowedTools": None,
    "rawMcpHeader": None,
    "authSubject": {},
    "flexTemplateJson": None,
    "flexSchema": None,
    "quickReplyConfig": None,
    "quickMenuConfig": None,
    "category": "knowledge_base",
    "displayCopyByLocale": None,
    "outputRenderTemplateByLocale": None,
    "toolDisplayMode": None,
    "groups": [
        {
            "id": "550e8400-e29b-41d4-a716-446655440000"
        }
    ]
}

response = requests.patch(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => null,
            'displayName' => 'サンプル文字列',
            'description' => 'サンプル文字列',
            'prompt' => 'サンプル文字列',
            'toolType' => 'api',
            'apiUrl' => 'サンプル文字列',
            'httpMethod' => null,
            'rawHeaders' => null,
            'sensitiveHeaders' => [
                'サンプル文字列'
            ],
            'rawQueryParams' => null,
            'rawParametersSchema' => null,
            'functionCode' => 'サンプル文字列',
            'mcpUrl' => 'サンプル文字列',
            'mcpRegistry' => '550e8400-e29b-41d4-a716-446655440000',
            'mcpAllowedTools' => null,
            'rawMcpHeader' => null,
            'authSubject' => new \stdClass(),
            'flexTemplateJson' => null,
            'flexSchema' => null,
            'quickReplyConfig' => null,
            'quickMenuConfig' => null,
            'category' => 'knowledge_base',
            'displayCopyByLocale' => null,
            'outputRenderTemplateByLocale' => null,
            'toolDisplayMode' => null,
            'groups' => [
                [
                    'id' => '550e8400-e29b-41d4-a716-446655440000'
                ]
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "name"?: // 異なる型の場合があります (任意)
  string // Tool name may only contain letters, digits, underscores (_) and hyphens (-). Not required for MCP tools; for API tools it is the tool name given to the LLM. (任意)
  "displayName": string // A name with any characters, used by users for configuration and management.
  "description"?: string // Tool description shown to users. Not required for MCP tools. (任意)
  "prompt"?: string // Tool description/prompt given to the LLM. If empty, the description field is used. Not required for MCP tools. (任意)
  "toolType"?: string (enum: api, function, mcp, desktop, flex, quick_reply, quick_menu) // * `api` - API
* `function` - Function
* `mcp` - MCP
* `desktop` - Desktop
* `flex` - Flex Message
* `quick_reply` - Quick Reply
* `quick_menu` - Quick Menu (任意)
  "apiUrl"?: string // 任意
  "httpMethod"?: // 異なる型の場合があります (任意)
  string (enum: get, post, put, delete, patch) // 任意
  "rawHeaders"?: object // 任意
  "rawHeadersMasked": object
  "sensitiveHeaders"?: [ // 任意
    string
  ]
  "globalSensitiveHeaders": [ // Expose platform defaults as read-only authoring guidance.
    string
  ]
  "rawQueryParams"?: object // Query string parameters appended to every request of this API tool. Values support the same {{variable}} template rendering as raw_headers. On key collision with LLM-generated arguments, these values win — use this field for API keys that must travel in the query string. (任意)
  "rawQueryParamsMasked": object
  "rawParametersSchema"?: object // 任意
  "functionCode"?: string // 任意
  "organization": string (uuid)
  "createdBy": string (uuid)
  "isGlobal": boolean // If set as global tool, all organizations can use this tool
  "mcpUrl"?: string // 任意
  "mcpRegistry"?: string (uuid) // Registry backing this MCP tool. Null for manual-URL MCP tools. (任意)
  "mcpAllowedTools"?: object // 任意
  "rawMcpHeader"?: object // Default headers used when the Contact has no matching MCP Credential. (任意)
  "rawMcpHeaderMasked": object
  "authSubject"?:  // Shared uses the tool level token plus per contact credentials; contact requires per contact authentication only; caller mints a short-lived token for the conversation-bound member (falls back to per contact credentials when the conversation has no bound member). MCP tools only.

* `shared` - Shared
* `contact` - Contact
* `caller` - Caller (任意)
  {
  }
  "flexTemplateJson"?: object // FlexMessage JSON template. Required for FLEX_MESSAGE tools. Stores the full LINE FlexMessage JSON structure (bubble / carousel / box / text / image / button etc.). (任意)
  "flexSchema"?: object // AI dynamic field schema for FlexMessage. JSON object whose keys are field paths parsed from flex_template_json (e.g. text / image url / button label / button uri / button message). Each value may be either a plain string (the AI prompt) or an object carrying additional metadata such as a field tag, e.g. {"prompt": "...", "tag": "title"}. Empty values fall back to the template default. (任意)
  "quickReplyConfig"?: object // Authoring config for QUICK_REPLY tools. Structured JSON describing the chip buttons: static list or dynamic (LLM-generated) mode, each field either a fixed value or an LLM prompt. (任意)
  "quickMenuConfig"?: object // Authoring config for QUICK_MENU tools. Structured JSON describing the persistent input-bar menu rendered by the web chat only: layout (grid / list), default open state, and 2-6 items each carrying a display label plus an action payload (send prompt / prefill text / open http(s) link). (任意)
  "category"?: string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // * `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "displayCopyByLocale"?: object // 任意
  "outputRenderTemplateByLocale"?: object // 任意
  "toolDisplayMode"?: // 異なる型の場合があります (任意)
  string (enum: full, compact, hidden) // 任意
  "groups"?: [ // Groups this tool is assigned to. Non-owner members must pick at least one group they belong to. (任意)
    {
      "id": string (uuid)
      "name": string
    }
  ]
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "canUpdate": boolean // Return whether the current user can update this resource.
  "canDelete": boolean // Return whether the current user can delete this resource.
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "prompt": "レスポンス文字列",
  "toolType": "api",
  "apiUrl": "レスポンス文字列",
  "httpMethod": "get",
  "rawHeaders": null,
  "rawHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "sensitiveHeaders": [
    "レスポンス文字列"
  ],
  "globalSensitiveHeaders": [
    "レスポンス文字列"
  ],
  "rawQueryParams": null,
  "rawQueryParamsMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "rawParametersSchema": null,
  "functionCode": "レスポンス文字列",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "isGlobal": false,
  "mcpUrl": "レスポンス文字列",
  "mcpRegistry": "550e8400-e29b-41d4-a716-446655440000",
  "mcpAllowedTools": null,
  "rawMcpHeader": null,
  "rawMcpHeaderMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "authSubject": {},
  "flexTemplateJson": null,
  "flexSchema": null,
  "quickReplyConfig": null,
  "quickMenuConfig": null,
  "category": "knowledge_base",
  "displayCopyByLocale": null,
  "outputRenderTemplateByLocale": null,
  "toolDisplayMode": "full",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    }
  ],
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "canUpdate": false,
  "canDelete": false
}
```

***

### ツールの削除 <a href="#tools-destroy" id="tools-destroy"></a>

DELETE `/api/v1/tools/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                   |
| ------ | -- | ------ | ------------------------------------ |
| `id`   | ✅  | string | A UUID string identifying this Tool. |

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しのサンプル (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### 利用可能なツールの一覧を取得 <a href="#tools-available-tools-create" id="tools-available-tools-create"></a>

POST `/api/v1/tools/available-tools/`

#### リクエストボディ

**リクエストパラメータ**

| フィールド           | 型              | 必須  | 説明                                        |
| --------------- | -------------- | --- | ----------------------------------------- |
| mcpUrl          | string         | はい  | MCP サーバー URL（必須）                          |
| rawMcpHeader    | object         | いいえ | MCP Header（JSON 形式）                       |
| mcpAllowedTools | array\[string] | いいえ | MCP で使用を許可するツールの一覧                        |
| toolId          | string (uuid)  | いいえ | Tool ID for per-member OAuth token lookup |

**リクエストスキーマの例**

```typescript
{
  "mcpUrl": string // MCP サーバー URL（必須）
  "rawMcpHeader"?: object // MCP Header（JSON 形式） (任意)
  "mcpAllowedTools"?: [ // MCP で使用を許可するツールの一覧 (任意)
    string
  ]
  "toolId"?: string (uuid) // Tool ID for per-member OAuth token lookup (任意)
}
```

**リクエスト値の例**

```json
{
  "mcpUrl": "サンプル文字列",
  "rawMcpHeader": null,
  "mcpAllowedTools": [
    "サンプル文字列"
  ],
  "toolId": "550e8400-e29b-41d4-a716-446655440000"
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/tools/available-tools/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mcpUrl": "サンプル文字列",
    "rawMcpHeader": null,
    "mcpAllowedTools": [
      "サンプル文字列"
    ],
    "toolId": "550e8400-e29b-41d4-a716-446655440000"
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "mcpUrl": "サンプル文字列",
    "rawMcpHeader": null,
    "mcpAllowedTools": [
      "サンプル文字列"
    ],
    "toolId": "550e8400-e29b-41d4-a716-446655440000"
  };

axios.post("https://api.maiagent.ai/api/v1/tools/available-tools/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/available-tools/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "mcpUrl": "サンプル文字列",
    "rawMcpHeader": None,
    "mcpAllowedTools": [
        "サンプル文字列"
    ],
    "toolId": "550e8400-e29b-41d4-a716-446655440000"
}

response = requests.post(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/tools/available-tools/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'mcpUrl' => 'サンプル文字列',
            'rawMcpHeader' => null,
            'mcpAllowedTools' => [
                'サンプル文字列'
            ],
            'toolId' => '550e8400-e29b-41d4-a716-446655440000'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "mcpUrl": string // MCP サーバー URL（必須）
  "rawMcpHeader"?: object // MCP Header（JSON 形式） (任意)
  "mcpAllowedTools"?: [ // MCP で使用を許可するツールの一覧 (任意)
    string
  ]
  "toolId"?: string (uuid) // Tool ID for per-member OAuth token lookup (任意)
  "availableTools": [ // 利用可能なすべての MCP ツールの一覧
    string
  ]
  "error":  // ツールの取得に失敗した理由です：{code, message}。code は url_rejected／invalid_header／dns_error／connect_error／tls_error／auth_error／timeout_error／handshake_error／unknown_error です。接続に成功した場合（サーバーにツールがない場合も含みます）は null です。非推奨の GET エンドポイントでは常に null です
  {
    "code": string // url_rejected / invalid_header / dns_error / connect_error / tls_error / auth_error / timeout_error / handshake_error / unknown_error
    "message": string // ユーザーのロケールに翻訳済みの理由です。そのまま表示できます
  }
}
```

**レスポンス値の例**

```json
{
  "mcpUrl": "レスポンス文字列",
  "rawMcpHeader": null,
  "mcpAllowedTools": [
    "レスポンス文字列"
  ],
  "toolId": "550e8400-e29b-41d4-a716-446655440000",
  "availableTools": [
    "レスポンス文字列"
  ],
  "error": {
    "code": "レスポンス文字列",
    "message": "レスポンス文字列"
  }
}
```

**ステータスコード: 400**

**レスポンススキーマの例**

```typescript
{
  "detail"?: string // 任意
}
```

**レスポンス値の例**

```json
{
  "detail": "レスポンス文字列"
}
```

***

### コネクタの作成 <a href="#connectors-create" id="connectors-create"></a>

POST `/api/v1/connectors/`

#### リクエストボディ

**リクエストパラメータ**

| フィールド                           | 型             | 必須  | 説明                                                                                                                                                                                                           |
| ------------------------------- | ------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| mcpRegistryId                   | string (uuid) | はい  |                                                                                                                                                                                                              |
| displayName                     | string        | いいえ | Custom display name for this connector (defaults to MCP Registry name)                                                                                                                                       |
| description                     | string        | いいえ | Custom description for this connector (defaults to MCP Registry description)                                                                                                                                 |
| defaultCategory                 | object        | いいえ | Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default\_category. `knowledge_base`: Knowledge base retrieval ; `web_search`: We... |
| defaultDisplayGroupNameByLocale | object        | いいえ | Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"": str}. The headline for the conversatio...          |
| defaultToolIcon                 | string        | いいえ | Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon.                  |
| authHeaders                     | object        | いいえ |                                                                                                                                                                                                              |
| allowedContextDataKeys          | object        | いいえ | Allowlist of webchat contextData keys this connector may render into auth\_headers through {{context\_data.}}. An empty list disables the feature for this connector: the placeholder is left verbati...     |
| exposedMcpTools                 | object        | いいえ | Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only ...  |
| isEnabled                       | boolean       | いいえ | Whether this connector is enabled for contacts in the organization                                                                                                                                           |

**リクエストスキーマの例**

```typescript
{
  "mcpRegistryId": string (uuid)
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 型が異なる場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "authHeaders"?: object // 任意
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
}
```

**リクエスト値の例**

```json
{
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "displayName": "文字列の例",
  "description": "文字列の例",
  "defaultCategory": null,
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "文字列の例",
  "authHeaders": null,
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": true
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/connectors/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "defaultCategory": null,
    "defaultDisplayGroupNameByLocale": null,
    "defaultToolIcon": "文字列の例",
    "authHeaders": null,
    "allowedContextDataKeys": null,
    "exposedMcpTools": null,
    "isEnabled": true
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "defaultCategory": null,
    "defaultDisplayGroupNameByLocale": null,
    "defaultToolIcon": "文字列の例",
    "authHeaders": null,
    "allowedContextDataKeys": null,
    "exposedMcpTools": null,
    "isEnabled": true
  };

axios.post("https://api.maiagent.ai/api/v1/connectors/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "defaultCategory": None,
    "defaultDisplayGroupNameByLocale": None,
    "defaultToolIcon": "文字列の例",
    "authHeaders": None,
    "allowedContextDataKeys": None,
    "exposedMcpTools": None,
    "isEnabled": True
}

response = requests.post(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/connectors/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'mcpRegistryId' => '550e8400-e29b-41d4-a716-446655440000',
            'displayName' => '文字列の例',
            'description' => '文字列の例',
            'defaultCategory' => null,
            'defaultDisplayGroupNameByLocale' => null,
            'defaultToolIcon' => '文字列の例',
            'authHeaders' => null,
            'allowedContextDataKeys' => null,
            'exposedMcpTools' => null,
            'isEnabled' => true
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 201**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "mcpRegistry": 
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 型が異なる場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "logoUrl": string (uri)
    "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
    "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
  "mcpRegistryId": string (uuid)
  "name": string
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 型が異なる場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "effectiveDescription": string
  "remoteMcpUrl": string
  "oauthServerUrl": string
  "logoUrl": string (uri)
  "authType": string
  "authHeaders"?: object // 任意
  "authHeadersMasked": object
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
  "organization": string (uuid)
  "createdBy": string (uuid)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "mcpRegistry": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "logoUrl": "https://example.com/file.jpg",
    "isActive": false,
    "isGlobal": false,
    "authType": {},
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  },
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "defaultCategory": "knowledge_base",
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "レスポンス文字列",
  "effectiveDescription": "レスポンス文字列",
  "remoteMcpUrl": "レスポンス文字列",
  "oauthServerUrl": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": "レスポンス文字列",
  "authHeaders": null,
  "authHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス名の例",
    "description": "レスポンスの説明の例"
  },
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": false,
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### コネクタ一覧を取得 <a href="#connectors-list" id="connectors-list"></a>

GET `/api/v1/connectors/`

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/connectors/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/connectors/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/connectors/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
[
  {
    "id": string (uuid)
    "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
    "mcpRegistryName": string
    "mcpRegistryId": string
    "mcpRegistryIsGlobal": boolean
    "logoUrl": string (uri)
    "defaultCategory"?: // 型が異なる場合があります (任意)
    string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
    "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
    "authHeadersMasked": object
    "allowedContextDataKeys": object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores.
    "authorizedMembersCount": integer
    "createdBy": 
    {
      "id": string (uuid)
      "name": string
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
]
```

**レスポンス値の例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "レスポンス文字列",
    "mcpRegistryName": "レスポンス文字列",
    "mcpRegistryId": "レスポンス文字列",
    "mcpRegistryIsGlobal": false,
    "logoUrl": "https://example.com/file.jpg",
    "defaultCategory": "knowledge_base",
    "isEnabled": false,
    "authHeadersMasked": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス名の例",
      "description": "レスポンスの説明の例"
    },
    "allowedContextDataKeys": null,
    "authorizedMembersCount": 456,
    "createdBy": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    },
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  }
]
```

***

### 特定のコネクタを取得 <a href="#connectors-retrieve" id="connectors-retrieve"></a>

GET `/api/v1/connectors/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明 |
| ------ | -- | ------ | -- |
| `id`   | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "mcpRegistry": 
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 型が異なる場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "logoUrl": string (uri)
    "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
    "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
  "mcpRegistryId": string (uuid)
  "name": string
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 異なる型の場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "effectiveDescription": string
  "remoteMcpUrl": string
  "oauthServerUrl": string
  "logoUrl": string (uri)
  "authType": string
  "authHeaders"?: object // 任意
  "authHeadersMasked": object
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
  "organization": string (uuid)
  "createdBy": string (uuid)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "mcpRegistry": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "logoUrl": "https://example.com/file.jpg",
    "isActive": false,
    "isGlobal": false,
    "authType": {},
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  },
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "defaultCategory": "knowledge_base",
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "レスポンス文字列",
  "effectiveDescription": "レスポンス文字列",
  "remoteMcpUrl": "レスポンス文字列",
  "oauthServerUrl": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": "レスポンス文字列",
  "authHeaders": null,
  "authHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス名の例",
    "description": "レスポンス説明の例"
  },
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": false,
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### コネクタを更新 <a href="#connectors-update" id="connectors-update"></a>

PUT `/api/v1/connectors/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明 |
| ------ | -- | ------ | -- |
| `id`   | ✅  | string |    |

#### リクエストボディ

**リクエストパラメータ**

| フィールド                           | 型             | 必須  | 説明                                                                                                                                                                                                           |
| ------------------------------- | ------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| mcpRegistryId                   | string (uuid) | はい  |                                                                                                                                                                                                              |
| displayName                     | string        | いいえ | Custom display name for this connector (defaults to MCP Registry name)                                                                                                                                       |
| description                     | string        | いいえ | Custom description for this connector (defaults to MCP Registry description)                                                                                                                                 |
| defaultCategory                 | object        | いいえ | Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default\_category. `knowledge_base`: Knowledge base retrieval ; `web_search`: We... |
| defaultDisplayGroupNameByLocale | object        | いいえ | Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"": str}. The headline for the conversatio...          |
| defaultToolIcon                 | string        | いいえ | Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon.                  |
| authHeaders                     | object        | いいえ |                                                                                                                                                                                                              |
| allowedContextDataKeys          | object        | いいえ | Allowlist of webchat contextData keys this connector may render into auth\_headers through {{context\_data.}}. An empty list disables the feature for this connector: the placeholder is left verbati...     |
| exposedMcpTools                 | object        | いいえ | Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only ...  |
| isEnabled                       | boolean       | いいえ | Whether this connector is enabled for contacts in the organization                                                                                                                                           |

**リクエストスキーマ例**

```typescript
{
  "mcpRegistryId": string (uuid)
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 異なる型の場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "authHeaders"?: object // 任意
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
}
```

**リクエスト値の例**

```json
{
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "defaultCategory": null,
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "サンプル文字列",
  "authHeaders": null,
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": true
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "defaultCategory": null,
    "defaultDisplayGroupNameByLocale": null,
    "defaultToolIcon": "サンプル文字列",
    "authHeaders": null,
    "allowedContextDataKeys": null,
    "exposedMcpTools": null,
    "isEnabled": true
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "defaultCategory": null,
    "defaultDisplayGroupNameByLocale": null,
    "defaultToolIcon": "サンプル文字列",
    "authHeaders": null,
    "allowedContextDataKeys": null,
    "exposedMcpTools": null,
    "isEnabled": true
  };

axios.put("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "defaultCategory": None,
    "defaultDisplayGroupNameByLocale": None,
    "defaultToolIcon": "サンプル文字列",
    "authHeaders": None,
    "allowedContextDataKeys": None,
    "exposedMcpTools": None,
    "isEnabled": True
}

response = requests.put(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'mcpRegistryId' => '550e8400-e29b-41d4-a716-446655440000',
            'displayName' => 'サンプル文字列',
            'description' => 'サンプル文字列',
            'defaultCategory' => null,
            'defaultDisplayGroupNameByLocale' => null,
            'defaultToolIcon' => 'サンプル文字列',
            'authHeaders' => null,
            'allowedContextDataKeys' => null,
            'exposedMcpTools' => null,
            'isEnabled' => true
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマ例**

```typescript
{
  "id": string (uuid)
  "mcpRegistry": 
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 異なる型の場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "logoUrl": string (uri)
    "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
    "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
  "mcpRegistryId": string (uuid)
  "name": string
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 異なる型の場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "effectiveDescription": string
  "remoteMcpUrl": string
  "oauthServerUrl": string
  "logoUrl": string (uri)
  "authType": string
  "authHeaders"?: object // 任意
  "authHeadersMasked": object
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
  "organization": string (uuid)
  "createdBy": string (uuid)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "mcpRegistry": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "logoUrl": "https://example.com/file.jpg",
    "isActive": false,
    "isGlobal": false,
    "authType": {},
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  },
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "defaultCategory": "knowledge_base",
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "レスポンス文字列",
  "effectiveDescription": "レスポンス文字列",
  "remoteMcpUrl": "レスポンス文字列",
  "oauthServerUrl": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": "レスポンス文字列",
  "authHeaders": null,
  "authHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス名の例",
    "description": "レスポンス説明の例"
  },
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": false,
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### コネクタを部分更新 <a href="#connectors-partial-update" id="connectors-partial-update"></a>

PATCH `/api/v1/connectors/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明 |
| ------ | -- | ------ | -- |
| `id`   | ✅  | string |    |

#### リクエストボディ

**リクエストパラメータ**

| フィールド                           | 型             | 必須  | 説明                                                                                                                                                                                                           |
| ------------------------------- | ------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| mcpRegistryId                   | string (uuid) | いいえ |                                                                                                                                                                                                              |
| displayName                     | string        | いいえ | Custom display name for this connector (defaults to MCP Registry name)                                                                                                                                       |
| description                     | string        | いいえ | Custom description for this connector (defaults to MCP Registry description)                                                                                                                                 |
| defaultCategory                 | object        | いいえ | Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default\_category. `knowledge_base`: Knowledge base retrieval ; `web_search`: We... |
| defaultDisplayGroupNameByLocale | object        | いいえ | Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"": str}. The headline for the conversatio...          |
| defaultToolIcon                 | string        | いいえ | Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon.                  |
| authHeaders                     | object        | いいえ |                                                                                                                                                                                                              |
| allowedContextDataKeys          | object        | いいえ | Allowlist of webchat contextData keys this connector may render into auth\_headers through {{context\_data.}}. An empty list disables the feature for this connector: the placeholder is left verbati...     |
| exposedMcpTools                 | object        | いいえ | Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only ...  |
| isEnabled                       | boolean       | いいえ | Whether this connector is enabled for contacts in the organization                                                                                                                                           |

**リクエストスキーマ例**

```typescript
{
  "mcpRegistryId"?: string (uuid) // 任意
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 異なる型の場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "authHeaders"?: object // 任意
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
}
```

**リクエストの値の例**

```json
{
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "defaultCategory": null,
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "サンプル文字列",
  "authHeaders": null,
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": true
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "defaultCategory": null,
    "defaultDisplayGroupNameByLocale": null,
    "defaultToolIcon": "サンプル文字列",
    "authHeaders": null,
    "allowedContextDataKeys": null,
    "exposedMcpTools": null,
    "isEnabled": true
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "defaultCategory": null,
    "defaultDisplayGroupNameByLocale": null,
    "defaultToolIcon": "サンプル文字列",
    "authHeaders": null,
    "allowedContextDataKeys": null,
    "exposedMcpTools": null,
    "isEnabled": true
  };

axios.patch("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "defaultCategory": None,
    "defaultDisplayGroupNameByLocale": None,
    "defaultToolIcon": "サンプル文字列",
    "authHeaders": None,
    "allowedContextDataKeys": None,
    "exposedMcpTools": None,
    "isEnabled": True
}

response = requests.patch(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'mcpRegistryId' => '550e8400-e29b-41d4-a716-446655440000',
            'displayName' => 'サンプル文字列',
            'description' => 'サンプル文字列',
            'defaultCategory' => null,
            'defaultDisplayGroupNameByLocale' => null,
            'defaultToolIcon' => 'サンプル文字列',
            'authHeaders' => null,
            'allowedContextDataKeys' => null,
            'exposedMcpTools' => null,
            'isEnabled' => true
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "mcpRegistry": 
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 異なる型を取る場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "logoUrl": string (uri)
    "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
    "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
  "mcpRegistryId": string (uuid)
  "name": string
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 異なる型を取る場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "effectiveDescription": string
  "remoteMcpUrl": string
  "oauthServerUrl": string
  "logoUrl": string (uri)
  "authType": string
  "authHeaders"?: object // 任意
  "authHeadersMasked": object
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
  "organization": string (uuid)
  "createdBy": string (uuid)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンスの値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "mcpRegistry": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "logoUrl": "https://example.com/file.jpg",
    "isActive": false,
    "isGlobal": false,
    "authType": {},
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  },
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "defaultCategory": "knowledge_base",
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "レスポンス文字列",
  "effectiveDescription": "レスポンス文字列",
  "remoteMcpUrl": "レスポンス文字列",
  "oauthServerUrl": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": "レスポンス文字列",
  "authHeaders": null,
  "authHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスの名前の例",
    "description": "レスポンスの説明の例"
  },
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": false,
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### コネクタの削除 <a href="#connectors-destroy" id="connectors-destroy"></a>

DELETE `/api/v1/connectors/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明 |
| ------ | -- | ------ | -- |
| `id`   | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストボディ (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### コネクタの承認済みメンバー一覧の取得 <a href="#connectors-authorized-members-retrieve" id="connectors-authorized-members-retrieve"></a>

GET `/api/v1/connectors/{id}/authorized-members/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明 |
| ------ | -- | ------ | -- |
| `id`   | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "mcpRegistry": 
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 異なる型を取る場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "logoUrl": string (uri)
    "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
    "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
  "mcpRegistryId": string (uuid)
  "name": string
  "displayName"?: string // Custom display name for this connector (defaults to MCP Registry name) (任意)
  "description"?: string // Custom description for this connector (defaults to MCP Registry description) (任意)
  "defaultCategory"?: // 異なる型を取る場合があります (任意)
  string (enum: knowledge_base, web_search, web_fetch, code_execution, file_processing, image_video_generation, database_query, third_party_integration, browser_operation, agent_collaboration, other) // Org-level override of the MCP Registry default category for this connector's dynamic tools. Empty = use the MCP Registry default_category.

* `knowledge_base` - Knowledge base retrieval
* `web_search` - Web search
* `web_fetch` - Web page fetch
* `code_execution` - Code execution
* `file_processing` - File processing
* `image_video_generation` - Image/video generation
* `database_query` - Database query
* `third_party_integration` - Third-party integration
* `browser_operation` - Browser operation
* `agent_collaboration` - Agent collaboration
* `other` - Other (catch-all) (任意)
  "defaultDisplayGroupNameByLocale"?: object // Locale-keyed server-level default group headline shown in chat for this connector's dynamic MCP tools (those without an individual Tool row). Shape: {"<locale>": str}. The headline for the conversation locale is resolved server-side (see whizchat.tools.services.tool_category.resolve_localized_text): requested locale -> settings.LANGUAGE_CODE locale -> empty, then streamed verbatim as displayGroupName. Empty = frontend falls back to its name-based heuristic. An individual Tool row overrides this. (任意)
  "defaultToolIcon"?: string // Server-level default icon identifier (a frontend icon key, not an uploaded image) for this connector's dynamic MCP tools. Empty = frontend uses its default MCP icon. Streamed as toolIcon. (任意)
  "effectiveDescription": string
  "remoteMcpUrl": string
  "oauthServerUrl": string
  "logoUrl": string (uri)
  "authType": string
  "authHeaders"?: object // 任意
  "authHeadersMasked": object
  "allowedContextDataKeys"?: object // Allowlist of webchat contextData keys this connector may render into auth_headers through {{context_data.<key>}}. An empty list disables the feature for this connector: the placeholder is left verbatim, exactly as before the feature existed. Keys are matched literally and are case-sensitive; at most 20 keys of letters, digits and underscores. (任意)
  "exposedMcpTools"?: object // Allowlist of MCP tool names this connector exposes (to the agent and to SEP-1865 UI cards). Empty list = expose all of the server tools. Use this to limit a connector to a safe subset (e.g. read-only tools). (任意)
  "isEnabled"?: boolean // Whether this connector is enabled for contacts in the organization (任意)
  "organization": string (uuid)
  "createdBy": string (uuid)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンスの値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "mcpRegistry": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "logoUrl": "https://example.com/file.jpg",
    "isActive": false,
    "isGlobal": false,
    "authType": {},
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  },
  "mcpRegistryId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "defaultCategory": "knowledge_base",
  "defaultDisplayGroupNameByLocale": null,
  "defaultToolIcon": "レスポンス文字列",
  "effectiveDescription": "レスポンス文字列",
  "remoteMcpUrl": "レスポンス文字列",
  "oauthServerUrl": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": "レスポンス文字列",
  "authHeaders": null,
  "authHeadersMasked": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスの名前の例",
    "description": "レスポンスの説明の例"
  },
  "allowedContextDataKeys": null,
  "exposedMcpTools": null,
  "isEnabled": false,
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "createdBy": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### コネクタの承認済みメンバーの削除 <a href="#connectors-authorized-members-destroy" id="connectors-authorized-members-destroy"></a>

DELETE `/api/v1/connectors/{id}/authorized-members/{memberId}/`

#### パラメータ

| パラメータ名     | 必須 | 型      | 説明 |
| ---------- | -- | ------ | -- |
| `id`       | ✅  | string |    |
| `memberId` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/{memberId}/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストボディ (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/{memberId}/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/{memberId}/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/connectors/550e8400-e29b-41d4-a716-446655440000/authorized-members/{memberId}/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### MCP ツールレジストリの一覧を取得します <a href="#mcp-registry-list" id="mcp-registry-list"></a>

GET `/api/v1/mcp/registry/`

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/mcp/registry/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/mcp/registry/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/registry/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/mcp/registry/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
[
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 異なる型の場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "logoUrl": string (uri)
    "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
    "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
]
```

**レスポンスの値の例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "logoUrl": "https://example.com/file.jpg",
    "isActive": false,
    "isGlobal": false,
    "authType": {},
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  }
]
```

***

### 特定の MCP ツールレジストリを取得します <a href="#mcp-registry-retrieve" id="mcp-registry-retrieve"></a>

GET `/api/v1/mcp/registry/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明 |
| ------ | -- | ------ | -- |
| `id`   | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/mcp/registry/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/mcp/registry/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/registry/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/mcp/registry/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "logoUrl": string (uri)
  "isActive"?: boolean // Whether this MCP service is currently available for use (任意)
  "isGlobal"?: boolean // Global registries are maintained by the platform and available to all organizations. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンスの値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": "https://example.com/file.jpg",
  "logoUrl": "https://example.com/file.jpg",
  "isActive": false,
  "isGlobal": false,
  "authType": {},
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### 組織のセルフホスト MCP Server の一覧を取得します <a href="#mcp-private-registry-list" id="mcp-private-registry-list"></a>

GET `/api/v1/mcp/private-registry/`

{% hint style="info" %}
コネクタの管理権限が必要です。接続方法は技術マニュアルの[セルフホスト MCP Server](https://docs.maiagent.ai/tech/advanced-genai-tech/self-hosted-mcp-server)を参照してください。
{% endhint %}

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/mcp/private-registry/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/mcp/private-registry/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/private-registry/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/mcp/private-registry/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
[
  {
    "id": string (uuid)
    "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
    "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
    "description"?: string // Brief description of the MCP service (任意)
    "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
    "oauthServerUrl"?: // 異なる型の場合があります (任意)
    string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
    "resourceIdentifier"?: // 異なる型の場合があります (任意)
    string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
    "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
    "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
    "logoUrl"?: // 異なる型の場合があります (任意)
    string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
    "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
    {
    }
    "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
    "isActive": boolean // Whether this MCP service is currently available for use
    "createdAt": string (timestamp)
    "updatedAt": string (timestamp)
  }
]
```

**レスポンスの値の例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "description": "レスポンス文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": "https://example.com/file.jpg",
    "resourceIdentifier": "https://example.com/file.jpg",
    "oauthClientId": "レスポンス文字列",
    "oauthClientSecret": "レスポンス文字列",
    "logoUrl": "https://example.com/file.jpg",
    "authType": {},
    "cspAllowedOrigins": null,
    "isActive": false,
    "createdAt": "レスポンス文字列",
    "updatedAt": "レスポンス文字列"
  }
]
```

***

### セルフホスト MCP Server を追加します <a href="#mcp-private-registry-create" id="mcp-private-registry-create"></a>

POST `/api/v1/mcp/private-registry/`

#### リクエストボディ

**リクエストパラメータ**

| フィールド              | 型            | 必須  | 説明                                                                                                                                                                                                             |
| ------------------ | ------------ | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name               | string       | はい  | MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.                                                                                                                   |
| displayName        | string       | いいえ | Human-readable display name (defaults to name if empty)                                                                                                                                                        |
| description        | string       | いいえ | Brief description of the MCP service                                                                                                                                                                           |
| remoteMcpUrl       | string (uri) | はい  | The URL of the Remote MCP service                                                                                                                                                                              |
| oauthServerUrl     | object       | いいえ | Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server ad...    |
| resourceIdentifier | object       | いいえ | Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discov...    |
| oauthClientId      | string       | いいえ | Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration.                                            |
| oauthClientSecret  | string       | いいえ | Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token\_endpoint\_auth\_method=none).                                       |
| logoUrl            | object       | いいえ | Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL.                                                                                                               |
| authType           | object       | いいえ | How to authenticate with this MCP server. `oauth`: OAuth 2.0 ; `service_account`: Service Account ; `none`: No Authentication;                                                                                 |
| cspAllowedOrigins  | object       | いいえ | Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. \['<https://viewer.diagrams.net>']. The sandboxed iframe denies all external origins by de... |

**リクエストスキーマの例**

```typescript
{
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
}
```

**リクエストの値の例**

```json
{
  "name": "サンプル名",
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": null,
  "resourceIdentifier": null,
  "oauthClientId": "サンプル文字列",
  "oauthClientSecret": "サンプル文字列",
  "logoUrl": null,
  "authType": {},
  "cspAllowedOrigins": null
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/mcp/private-registry/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": null,
    "resourceIdentifier": null,
    "oauthClientId": "サンプル文字列",
    "oauthClientSecret": "サンプル文字列",
    "logoUrl": null,
    "authType": {},
    "cspAllowedOrigins": null
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "name": "サンプル名",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": null,
    "resourceIdentifier": null,
    "oauthClientId": "サンプル文字列",
    "oauthClientSecret": "サンプル文字列",
    "logoUrl": null,
    "authType": {},
    "cspAllowedOrigins": null
  };

axios.post("https://api.maiagent.ai/api/v1/mcp/private-registry/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/private-registry/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト本文 (payload)
data = {
    "name": "名前の例",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": None,
    "resourceIdentifier": None,
    "oauthClientId": "文字列の例",
    "oauthClientSecret": "文字列の例",
    "logoUrl": None,
    "authType": {},
    "cspAllowedOrigins": None
}

response = requests.post(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/mcp/private-registry/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => '名前の例',
            'displayName' => '文字列の例',
            'description' => '文字列の例',
            'remoteMcpUrl' => 'https://example.com/file.jpg',
            'oauthServerUrl' => null,
            'resourceIdentifier' => null,
            'oauthClientId' => '文字列の例',
            'oauthClientSecret' => '文字列の例',
            'logoUrl' => null,
            'authType' => new \stdClass(),
            'cspAllowedOrigins' => null
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス本文

**ステータスコード: 201**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
  "isActive": boolean // Whether this MCP service is currently available for use
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": "https://example.com/file.jpg",
  "resourceIdentifier": "https://example.com/file.jpg",
  "oauthClientId": "レスポンス文字列",
  "oauthClientSecret": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": {},
  "cspAllowedOrigins": null,
  "isActive": false,
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### 特定のセルフホスト MCP Server の取得 <a href="#mcp-private-registry-retrieve" id="mcp-private-registry-retrieve"></a>

GET `/api/v1/mcp/private-registry/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                           |
| ------ | -- | ------ | -------------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this MCP Registry. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーの設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス本文

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
  "isActive": boolean // Whether this MCP service is currently available for use
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": "https://example.com/file.jpg",
  "resourceIdentifier": "https://example.com/file.jpg",
  "oauthClientId": "レスポンス文字列",
  "oauthClientSecret": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": {},
  "cspAllowedOrigins": null,
  "isActive": false,
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### セルフホスト MCP Server の部分更新 <a href="#mcp-private-registry-partial-update" id="mcp-private-registry-partial-update"></a>

PATCH `/api/v1/mcp/private-registry/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                           |
| ------ | -- | ------ | -------------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this MCP Registry. |

#### リクエスト本文

**リクエストパラメータ**

| フィールド              | 型            | 必須  | 説明                                                                                                                                                                                                             |
| ------------------ | ------------ | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name               | string       | いいえ | MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.                                                                                                                   |
| displayName        | string       | いいえ | Human-readable display name (defaults to name if empty)                                                                                                                                                        |
| description        | string       | いいえ | Brief description of the MCP service                                                                                                                                                                           |
| remoteMcpUrl       | string (uri) | いいえ | The URL of the Remote MCP service                                                                                                                                                                              |
| oauthServerUrl     | object       | いいえ | Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server ad...    |
| resourceIdentifier | object       | いいえ | Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discov...    |
| oauthClientId      | string       | いいえ | Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration.                                            |
| oauthClientSecret  | string       | いいえ | Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token\_endpoint\_auth\_method=none).                                       |
| logoUrl            | object       | いいえ | Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL.                                                                                                               |
| authType           | object       | いいえ | How to authenticate with this MCP server. `oauth`: OAuth 2.0 ; `service_account`: Service Account ; `none`: No Authentication;                                                                                 |
| cspAllowedOrigins  | object       | いいえ | Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. \['<https://viewer.diagrams.net>']. The sandboxed iframe denies all external origins by de... |

**リクエストスキーマの例**

```typescript
{
  "name"?: string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed. (任意)
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl"?: string (uri) // The URL of the Remote MCP service (任意)
  "oauthServerUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
}
```

**リクエスト値の例**

```json
{
  "name": "名前の例",
  "displayName": "文字列の例",
  "description": "文字列の例",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": null,
  "resourceIdentifier": null,
  "oauthClientId": "文字列の例",
  "oauthClientSecret": "文字列の例",
  "logoUrl": null,
  "authType": {},
  "cspAllowedOrigins": null
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "名前の例",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": null,
    "resourceIdentifier": null,
    "oauthClientId": "文字列の例",
    "oauthClientSecret": "文字列の例",
    "logoUrl": null,
    "authType": {},
    "cspAllowedOrigins": null
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーの設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエスト本文 (payload)
const data = {
    "name": "名前の例",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": null,
    "resourceIdentifier": null,
    "oauthClientId": "文字列の例",
    "oauthClientSecret": "文字列の例",
    "logoUrl": null,
    "authType": {},
    "cspAllowedOrigins": null
  };

axios.patch("https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト本文 (payload)
data = {
    "name": "名前の例",
    "displayName": "文字列の例",
    "description": "文字列の例",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": None,
    "resourceIdentifier": None,
    "oauthClientId": "文字列の例",
    "oauthClientSecret": "文字列の例",
    "logoUrl": None,
    "authType": {},
    "cspAllowedOrigins": None
}

response = requests.patch(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => '名前の例',
            'displayName' => '文字列の例',
            'description' => '文字列の例',
            'remoteMcpUrl' => 'https://example.com/file.jpg',
            'oauthServerUrl' => null,
            'resourceIdentifier' => null,
            'oauthClientId' => '文字列の例',
            'oauthClientSecret' => '文字列の例',
            'logoUrl' => null,
            'authType' => new \stdClass(),
            'cspAllowedOrigins' => null
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス本文

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 複数の型を取り得ます (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 複数の型を取り得ます (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
  "isActive": boolean // Whether this MCP service is currently available for use
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": "https://example.com/file.jpg",
  "resourceIdentifier": "https://example.com/file.jpg",
  "oauthClientId": "レスポンス文字列",
  "oauthClientSecret": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": {},
  "cspAllowedOrigins": null,
  "isActive": false,
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### セルフホスト MCP Server の削除 <a href="#mcp-private-registry-destroy" id="mcp-private-registry-destroy"></a>

DELETE `/api/v1/mcp/private-registry/{id}/`

#### パラメータ

| パラメーター名 | 必須 | 型      | 説明                                           |
| ------- | -- | ------ | -------------------------------------------- |
| `id`    | ✅  | string | A UUID string identifying this MCP Registry. |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストボディ (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/mcp/private-registry/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### MCP Server の接続テスト <a href="#mcp-private-registry-test-connection-create" id="mcp-private-registry-test-connection-create"></a>

POST `/api/v1/mcp/private-registry/test-connection/`

#### リクエストボディ

**リクエストパラメーター**

| フィールド              | 型            | 必須  | 説明                                                                                                                                                                                                             |
| ------------------ | ------------ | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name               | string       | はい  | MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.                                                                                                                   |
| displayName        | string       | いいえ | Human-readable display name (defaults to name if empty)                                                                                                                                                        |
| description        | string       | いいえ | Brief description of the MCP service                                                                                                                                                                           |
| remoteMcpUrl       | string (uri) | はい  | The URL of the Remote MCP service                                                                                                                                                                              |
| oauthServerUrl     | object       | いいえ | Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server ad...    |
| resourceIdentifier | object       | いいえ | Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discov...    |
| oauthClientId      | string       | いいえ | Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration.                                            |
| oauthClientSecret  | string       | いいえ | Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token\_endpoint\_auth\_method=none).                                       |
| logoUrl            | object       | いいえ | Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL.                                                                                                               |
| authType           | object       | いいえ | How to authenticate with this MCP server. `oauth`: OAuth 2.0 ; `service_account`: Service Account ; `none`: No Authentication;                                                                                 |
| cspAllowedOrigins  | object       | いいえ | Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. \['<https://viewer.diagrams.net>']. The sandboxed iframe denies all external origins by de... |

**リクエストスキーマの例**

```typescript
{
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
}
```

**リクエストのサンプル値**

```json
{
  "name": "サンプル名",
  "displayName": "サンプル文字列",
  "description": "サンプル文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": null,
  "resourceIdentifier": null,
  "oauthClientId": "サンプル文字列",
  "oauthClientSecret": "サンプル文字列",
  "logoUrl": null,
  "authType": {},
  "cspAllowedOrigins": null
}
```

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/mcp/private-registry/test-connection/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": null,
    "resourceIdentifier": null,
    "oauthClientId": "サンプル文字列",
    "oauthClientSecret": "サンプル文字列",
    "logoUrl": null,
    "authType": {},
    "cspAllowedOrigins": null
  }'

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "name": "サンプル名",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": null,
    "resourceIdentifier": null,
    "oauthClientId": "サンプル文字列",
    "oauthClientSecret": "サンプル文字列",
    "logoUrl": null,
    "authType": {},
    "cspAllowedOrigins": null
  };

axios.post("https://api.maiagent.ai/api/v1/mcp/private-registry/test-connection/", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/mcp/private-registry/test-connection/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "name": "サンプル名",
    "displayName": "サンプル文字列",
    "description": "サンプル文字列",
    "remoteMcpUrl": "https://example.com/file.jpg",
    "oauthServerUrl": None,
    "resourceIdentifier": None,
    "oauthClientId": "サンプル文字列",
    "oauthClientSecret": "サンプル文字列",
    "logoUrl": None,
    "authType": {},
    "cspAllowedOrigins": None
}

response = requests.post(url, json=data, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/mcp/private-registry/test-connection/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => 'サンプル名',
            'displayName' => 'サンプル文字列',
            'description' => 'サンプル文字列',
            'remoteMcpUrl' => 'https://example.com/file.jpg',
            'oauthServerUrl' => null,
            'resourceIdentifier' => null,
            'oauthClientId' => 'サンプル文字列',
            'oauthClientSecret' => 'サンプル文字列',
            'logoUrl' => null,
            'authType' => new \stdClass(),
            'cspAllowedOrigins' => null
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string // MCP service name (e.g., Supabase, Sentry). Only alphanumeric, underscore and hyphen allowed.
  "displayName"?: string // Human-readable display name (defaults to name if empty) (任意)
  "description"?: string // Brief description of the MCP service (任意)
  "remoteMcpUrl": string (uri) // The URL of the Remote MCP service
  "oauthServerUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth authorization server URL. Leave empty to auto-discover from the MCP server (RFC 9728 protected resource metadata). Only fill in when auto-discovery fails or the server advertises incorrect metadata. (e.g., Supabase MCP is at mcp.supabase.com but OAuth is at api.supabase.com) (任意)
  "resourceIdentifier"?: // 異なる型の場合があります (任意)
  string (uri) // Manual override for the OAuth resource identifier (RFC 9728 / RFC 8707). Leave empty to auto-discover from the MCP server's .well-known/oauth-protected-resource endpoint. Only fill in when auto-discovery fails or the metadata is incorrect. (e.g., Asana uses https://mcp.asana.com, Supabase uses https://mcp.supabase.com/mcp) (任意)
  "oauthClientId"?: string // Pre-registered OAuth client ID for MCP servers that do not support dynamic client registration (RFC 7591). Leave empty if the server supports dynamic registration. (任意)
  "oauthClientSecret"?: string // Pre-registered OAuth client secret. Required only if the MCP server requires a confidential client. Leave empty for public clients (token_endpoint_auth_method=none). (任意)
  "logoUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Logo: the uploaded storage object key (media/...) or an external URL; read back as a signed URL. (任意)
  "authType"?:  // How to authenticate with this MCP server.

* `oauth` - OAuth 2.0
* `service_account` - Service Account
* `none` - No Authentication (任意)
  {
  }
  "cspAllowedOrigins"?: object // Extra origins a SEP-1865 MCP App card from this server may load from (script-src/img-src/connect-src etc.), e.g. ['https://viewer.diagrams.net']. The sandboxed iframe denies all external origins by default; list only what the app genuinely needs. Empty = the host's strict default (self only). (任意)
  "isActive": boolean // Whether this MCP service is currently available for use
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "displayName": "レスポンス文字列",
  "description": "レスポンス文字列",
  "remoteMcpUrl": "https://example.com/file.jpg",
  "oauthServerUrl": "https://example.com/file.jpg",
  "resourceIdentifier": "https://example.com/file.jpg",
  "oauthClientId": "レスポンス文字列",
  "oauthClientSecret": "レスポンス文字列",
  "logoUrl": "https://example.com/file.jpg",
  "authType": {},
  "cspAllowedOrigins": null,
  "isActive": false,
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列"
}
```

***

### ツール実行履歴の一覧取得 <a href="#tool-execution-records-list" id="tool-execution-records-list"></a>

GET `/api/v1/tool-execution-records/`

#### パラメータ

| パラメータ名      | 必須 | 型       | 説明                                                |
| ----------- | -- | ------- | ------------------------------------------------- |
| `chatbot`   | ❌  | string  | AI アシスタント ID で絞り込みます                              |
| `endDate`   | ❌  | string  | 終了日（当日を含む）です。形式：YYYY-MM-DD                        |
| `page`      | ❌  | integer | A page number within the paginated result set.    |
| `pageSize`  | ❌  | integer | Number of results to return per page.             |
| `query`     | ❌  | string  | AI アシスタント名、ツール名、メッセージ内容を検索します                     |
| `startDate` | ❌  | string  | 開始日（当日を含む）です。形式：YYYY-MM-DD                        |
| `status`    | ❌  | string  | 実行ステータスで絞り込みます：success, failure, pending, timeout |
| `tool`      | ❌  | string  | ツール ID で絞り込みます                                    |
| `toolType`  | ❌  | string  | ツールタイプで絞り込みます：api, function, mcp                  |

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "tool": object // ツール情報
      "chatbot": object // AI アシスタント情報
      "messageContent": string // メッセージ内容
      "status"?: string (enum: success, failure, pending, timeout) // * `success` - Success
* `failure` - Failed
* `pending` - Processing
* `timeout` - Timeout (任意)
      "executionTime": integer // 実行時間（ミリ秒）
      "errorMessage"?: string // 任意
      "retryCount"?: integer // How many times the platform auto-retried this tool call before the final outcome (0 = the first attempt was the final one). API tools count tenacity retries inside APIRequestService; MCP tools count transient-error retries (read-classified tools only). Function tools are never auto-retried. (任意)
      "createdAt": string (timestamp)
      "source": string // Scheduled runs' tool calls are attributed via ChatbotScheduleExecution.user_message.
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "tool": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "chatbot": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "messageContent": "レスポンス文字列",
      "status": "success",
      "executionTime": 456,
      "errorMessage": "レスポンス文字列",
      "retryCount": 456,
      "createdAt": "レスポンス文字列",
      "source": "レスポンス文字列"
    }
  ]
}
```

***

### 特定のツール実行履歴の取得 <a href="#tool-execution-records-retrieve" id="tool-execution-records-retrieve"></a>

GET `/api/v1/tool-execution-records/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                                    |
| ------ | -- | ------ | ----------------------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this Tool Execution Record. |

#### コードサンプル

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "tool": object // ツール情報（operated_tool_name を含む）
  "chatbot": object // AI アシスタント情報
  "message": 
  {
    "id": string (uuid)
    "content": string
  }
  "inputParameters": object
  "outputResult"?: object // 任意
  "errorMessage"?: string // 任意
  "status"?: string (enum: success, failure, pending, timeout) // * `success` - Success
* `failure` - Failed
* `pending` - Processing
* `timeout` - Timeout (任意)
  "executionTime": integer // 実行時間（ミリ秒）
  "retryCount"?: integer // How many times the platform auto-retried this tool call before the final outcome (0 = the first attempt was the final one). API tools count tenacity retries inside APIRequestService; MCP tools count transient-error retries (read-classified tools only). Function tools are never auto-retried. (任意)
  "requestUrl"?: // 異なる型の場合があります (任意)
  string (uri) // Final rendered URL used when calling an API tool. Null for non-API tools. (任意)
  "requestMethod"?: string // HTTP method (GET/POST/...) used when calling an API tool. Null for non-API tools. (任意)
  "requestHeaders": object // Return rendered request headers with sensitive values masked.

Three sources are unioned, any hit masks: ``settings.TOOL_API_SENSITIVE_HEADERS``,
APICredential keys for the (contact, tool) pair, and the tool's current
``sensitive_headers``. The tool list is applied at read time against the stored
value, so editing it changes how existing records render without rewriting them.
  "requestBody"?: object // Final rendered body sent to the external API. Null for non-API tools or read-only methods. (任意)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "source": string // Scheduled runs' tool calls are attributed via ChatbotScheduleExecution.user_message.
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "tool": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "chatbot": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "message": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "レスポンス文字列"
  },
  "inputParameters": null,
  "outputResult": null,
  "errorMessage": "レスポンス文字列",
  "status": "success",
  "executionTime": 456,
  "retryCount": 456,
  "requestUrl": "https://example.com/file.jpg",
  "requestMethod": "レスポンス文字列",
  "requestHeaders": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "requestBody": null,
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "source": "レスポンス文字列"
}
```

***

### 実行履歴の AI アシスタントの絞り込みオプションを取得 <a href="#tool-execution-records-chatbots-list" id="tool-execution-records-chatbots-list"></a>

GET `/api/v1/tool-execution-records/chatbots/`

#### パラメータ

| パラメータ名      | 必須 | 型      | 説明                                                                                                                                                                  |
| ----------- | -- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chatbot`   | ❌  | string |                                                                                                                                                                     |
| `endDate`   | ❌  | string |                                                                                                                                                                     |
| `query`     | ❌  | string |                                                                                                                                                                     |
| `startDate` | ❌  | string |                                                                                                                                                                     |
| `status`    | ❌  | string | \`success\`: Success ; \`failure\`: Failed ; \`pending\`: Processing ; \`timeout\`: Timeout;                                                                        |
| `tool`      | ❌  | string |                                                                                                                                                                     |
| `toolType`  | ❌  | string | \`api\`: API ; \`function\`: Function ; \`mcp\`: MCP ; \`desktop\`: Desktop ; \`flex\`: Flex Message ; \`quick\_reply\`: Quick Reply ; \`quick\_menu\`: Quick Menu; |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
[
  {
    "id": string (uuid)
    "name": string // Chatbot name. In Agent mode it carries semantic meaning; in other modes it only distinguishes chatbots.
    "team": 
    {
      "id": string (uuid)
      "name": string
    }
  }
]
```

**レスポンスの値の例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "team": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    }
  }
]
```

***

### 実行履歴のツールフィルターオプションの取得 <a href="#tool-execution-records-tools-list" id="tool-execution-records-tools-list"></a>

GET `/api/v1/tool-execution-records/tools/`

#### パラメータ

| パラメータ名      | 必須 | 型       | 説明                                                                                                                                                                  |
| ----------- | -- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chatbot`   | ❌  | string  |                                                                                                                                                                     |
| `endDate`   | ❌  | string  |                                                                                                                                                                     |
| `page`      | ❌  | integer | A page number within the paginated result set.                                                                                                                      |
| `pageSize`  | ❌  | integer | Number of results to return per page.                                                                                                                               |
| `query`     | ❌  | string  |                                                                                                                                                                     |
| `startDate` | ❌  | string  |                                                                                                                                                                     |
| `status`    | ❌  | string  | \`success\`: Success ; \`failure\`: Failed ; \`pending\`: Processing ; \`timeout\`: Timeout;                                                                        |
| `tool`      | ❌  | string  |                                                                                                                                                                     |
| `toolType`  | ❌  | string  | \`api\`: API ; \`function\`: Function ; \`mcp\`: MCP ; \`desktop\`: Desktop ; \`flex\`: Flex Message ; \`quick\_reply\`: Quick Reply ; \`quick\_menu\`: Quick Menu; |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", config)
  .then(response => {
    console.log('レスポンスを取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "displayName": string
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "displayName": "レスポンス文字列"
    }
  ]
}
```

***

### 特定ツールの実行履歴一覧の取得 <a href="#tools-tool-execution-records-list" id="tools-tool-execution-records-list"></a>

GET `/api/v1/tools/{toolPk}/tool-execution-records/`

#### パラメータ

| パラメータ名      | 必須 | 型       | 説明                                                  |
| ----------- | -- | ------- | --------------------------------------------------- |
| `toolPk`    | ✅  | string  |                                                     |
| `chatbot`   | ❌  | string  | AI アシスタント ID でフィルターします                              |
| `endDate`   | ❌  | string  | 終了日（当日を含む）、形式：YYYY-MM-DD                            |
| `page`      | ❌  | integer | A page number within the paginated result set.      |
| `pageSize`  | ❌  | integer | Number of results to return per page.               |
| `query`     | ❌  | string  | AI アシスタント名、ツール名、メッセージ内容を検索します                       |
| `startDate` | ❌  | string  | 開始日（当日を含む）、形式：YYYY-MM-DD                            |
| `status`    | ❌  | string  | 実行ステータスでフィルターします：success, failure, pending, timeout |
| `tool`      | ❌  | string  | ツール ID でフィルターします                                    |
| `toolType`  | ❌  | string  | ツールタイプでフィルターします：api, function, mcp                  |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api", config)
  .then(response => {
    console.log('レスポンスを取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/?chatbot=example&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=example&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "tool": object // ツール情報を取得します
      "chatbot": object // AI アシスタント情報を取得します
      "messageContent": string // メッセージ内容を取得します
      "status"?: string (enum: success, failure, pending, timeout) // * `success` - Success
* `failure` - Failed
* `pending` - Processing
* `timeout` - Timeout (任意)
      "executionTime": integer // 実行時間（ミリ秒）を取得します
      "errorMessage"?: string // 任意
      "retryCount"?: integer // How many times the platform auto-retried this tool call before the final outcome (0 = the first attempt was the final one). API tools count tenacity retries inside APIRequestService; MCP tools count transient-error retries (read-classified tools only). Function tools are never auto-retried. (任意)
      "createdAt": string (timestamp)
      "source": string // Scheduled runs' tool calls are attributed via ChatbotScheduleExecution.user_message.
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "tool": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "chatbot": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンスのサンプル名",
        "description": "レスポンスのサンプル説明"
      },
      "messageContent": "レスポンス文字列",
      "status": "success",
      "executionTime": 456,
      "errorMessage": "レスポンス文字列",
      "retryCount": 456,
      "createdAt": "レスポンス文字列",
      "source": "レスポンス文字列"
    }
  ]
}
```

***

### 特定ツールの特定の実行履歴の取得 <a href="#tools-tool-execution-records-retrieve" id="tools-tool-execution-records-retrieve"></a>

GET `/api/v1/tools/{toolPk}/tool-execution-records/{id}/`

#### パラメータ

| パラメータ名   | 必須 | 型      | 説明                                                    |
| -------- | -- | ------ | ----------------------------------------------------- |
| `id`     | ✅  | string | A UUID string identifying this Tool Execution Record. |
| `toolPk` | ✅  | string |                                                       |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('レスポンスを取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "tool": object // ツール情報を取得します（operated_tool_name を含む）
  "chatbot": object // AI アシスタント情報を取得します
  "message": 
  {
    "id": string (uuid)
    "content": string
  }
  "inputParameters": object
  "outputResult"?: object // 任意
  "errorMessage"?: string // 任意
  "status"?: string (enum: success, failure, pending, timeout) // * `success` - Success
* `failure` - Failed
* `pending` - Processing
* `timeout` - Timeout (任意)
  "executionTime": integer // 実行時間（ミリ秒）を取得します
  "retryCount"?: integer // How many times the platform auto-retried this tool call before the final outcome (0 = the first attempt was the final one). API tools count tenacity retries inside APIRequestService; MCP tools count transient-error retries (read-classified tools only). Function tools are never auto-retried. (任意)
  "requestUrl"?: // 複数の型を取る可能性があります (任意)
  string (uri) // Final rendered URL used when calling an API tool. Null for non-API tools. (任意)
  "requestMethod"?: string // HTTP method (GET/POST/...) used when calling an API tool. Null for non-API tools. (任意)
  "requestHeaders": object // Return rendered request headers with sensitive values masked.

Three sources are unioned, any hit masks: ``settings.TOOL_API_SENSITIVE_HEADERS``,
APICredential keys for the (contact, tool) pair, and the tool's current
``sensitive_headers``. The tool list is applied at read time against the stored
value, so editing it changes how existing records render without rewriting them.
  "requestBody"?: object // Final rendered body sent to the external API. Null for non-API tools or read-only methods. (任意)
  "createdAt": string (timestamp)
  "updatedAt": string (timestamp)
  "source": string // Scheduled runs' tool calls are attributed via ChatbotScheduleExecution.user_message.
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "tool": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "chatbot": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "message": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "レスポンス文字列"
  },
  "inputParameters": null,
  "outputResult": null,
  "errorMessage": "レスポンス文字列",
  "status": "success",
  "executionTime": 456,
  "retryCount": 456,
  "requestUrl": "https://example.com/file.jpg",
  "requestMethod": "レスポンス文字列",
  "requestHeaders": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンスのサンプル名",
    "description": "レスポンスのサンプル説明"
  },
  "requestBody": null,
  "createdAt": "レスポンス文字列",
  "updatedAt": "レスポンス文字列",
  "source": "レスポンス文字列"
}
```

***

### 特定のツールの実行記録に対する AI アシスタントのフィルターオプションを取得 <a href="#tools-tool-execution-records-chatbots-list" id="tools-tool-execution-records-chatbots-list"></a>

GET `/api/v1/tools/{toolPk}/tool-execution-records/chatbots/`

#### パラメータ

| パラメータ名      | 必須 | 型      | 説明                                                                                                                                                                  |
| ----------- | -- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `toolPk`    | ✅  | string |                                                                                                                                                                     |
| `chatbot`   | ❌  | string |                                                                                                                                                                     |
| `endDate`   | ❌  | string |                                                                                                                                                                     |
| `query`     | ❌  | string |                                                                                                                                                                     |
| `startDate` | ❌  | string |                                                                                                                                                                     |
| `status`    | ❌  | string | \`success\`: Success ; \`failure\`: Failed ; \`pending\`: Processing ; \`timeout\`: Timeout;                                                                        |
| `tool`      | ❌  | string |                                                                                                                                                                     |
| `toolType`  | ❌  | string | \`api\`: API ; \`function\`: Function ; \`mcp\`: MCP ; \`desktop\`: Desktop ; \`flex\`: Flex Message ; \`quick\_reply\`: Quick Reply ; \`quick\_menu\`: Quick Menu; |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/chatbots/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
[
  {
    "id": string (uuid)
    "name": string // Chatbot name. In Agent mode it carries semantic meaning; in other modes it only distinguishes chatbots.
    "team": 
    {
      "id": string (uuid)
      "name": string
    }
  }
]
```

**レスポンスの値の例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "team": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列"
    }
  }
]
```

***

### 特定ツールの実行履歴に対するツールのフィルターオプションを取得 <a href="#tools-tool-execution-records-tools-list" id="tools-tool-execution-records-tools-list"></a>

GET `/api/v1/tools/{toolPk}/tool-execution-records/tools/`

#### パラメータ

| パラメータ名      | 必須 | 型       | 説明                                                                                                                                                                  |
| ----------- | -- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `toolPk`    | ✅  | string  |                                                                                                                                                                     |
| `chatbot`   | ❌  | string  |                                                                                                                                                                     |
| `endDate`   | ❌  | string  |                                                                                                                                                                     |
| `page`      | ❌  | integer | A page number within the paginated result set.                                                                                                                      |
| `pageSize`  | ❌  | integer | Number of results to return per page.                                                                                                                               |
| `query`     | ❌  | string  |                                                                                                                                                                     |
| `startDate` | ❌  | string  |                                                                                                                                                                     |
| `status`    | ❌  | string  | \`success\`: Success ; \`failure\`: Failed ; \`pending\`: Processing ; \`timeout\`: Timeout;                                                                        |
| `tool`      | ❌  | string  |                                                                                                                                                                     |
| `toolType`  | ❌  | string  | \`api\`: API ; \`function\`: Function ; \`mcp\`: MCP ; \`desktop\`: Desktop ; \`flex\`: Flex Message ; \`quick\_reply\`: Quick Reply ; \`quick\_menu\`: Quick Menu; |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", config)
  .then(response => {
    console.log('レスポンスを取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/tools/550e8400-e29b-41d4-a716-446655440000/tool-execution-records/tools/?chatbot=550e8400-e29b-41d4-a716-446655440000&endDate=example&page=1&pageSize=1&query=example&startDate=example&status=failure&tool=550e8400-e29b-41d4-a716-446655440000&toolType=api", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "displayName": string
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "displayName": "レスポンス文字列"
    }
  ]
}
```

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/api/ja/api-reference/gong-ju-he-lian-jie-qi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
