Skip to content

MCP Service: REST API Contract

This document defines the RESTful API for the mcp_service. This API exposes a set of tools that the ai_service can execute.

Base URL: /tools


1. Tool: Manage User Group

Manages user membership in groups.

  • Endpoint: POST /manageUserGroup
  • Description: Adds or removes a user from a specified group.

Request Body

{
  "action": "ADD" | "REMOVE",
  "userId": "string",
  "groupName": "string"
}

Response Body

{
  "success": "boolean",
  "message": "string"
}
* Example Success: { "success": true, "message": "User 'jdoe' added to group 'auditors'." } * Example Error: { "success": false, "message": "Group 'nonexistent_group' not found." }


2. Tool: Query Users

Searches for users based on defined criteria.

  • Endpoint: POST /queryUsers
  • Description: Finds users in the system. Initially supports querying by email.

Request Body

{
  "email": "string"
}

Response Body

{
  "users": [
    {
      "id": "string",
      "name": "string",
      "email": "string",
      "status": "string"
    }
  ]
}

3. Tool: Search Knowledge Base

Performs a search against the project's documentation.

  • Endpoint: POST /searchKnowledgeBase
  • Description: Searches the /docs repository for relevant information.

Request Body

{
  "query": "string"
}

Response Body

{
  "results": [
    {
      "title": "string",
      "url": "string",
      "snippet": "string"
    }
  ]
}

4. Tool: Query Audit Trail

Retrieves logs from the security audit trail.

  • Endpoint: POST /queryAuditTrail
  • Description: Allows querying the audit trail, filtered by user.

Request Body

{
  "userId": "string",
  "limit": "number (optional, default: 25)"
}

Response Body

{
  "logs": [
    {
      "timestamp": "string",
      "action": "string",
      "details": "string"
    }
  ]
}