|
|
@@ -20,6 +20,13 @@ import { orderTools } from './tools/order-tools.js';
|
|
|
import { areaTools } from './tools/area-tools.js';
|
|
|
import { companyTools } from './tools/company-tools.js';
|
|
|
import { authTools } from './tools/auth-tools.js';
|
|
|
+import { fileTools } from './tools/file-tools.js';
|
|
|
+import { bankNameTools } from './tools/bank-name-tools.js';
|
|
|
+import { channelTools } from './tools/channel-tools.js';
|
|
|
+import { disabilityTools } from './tools/disability-tools.js';
|
|
|
+import { disabilityCompanyTools } from './tools/disability-company-tools.js';
|
|
|
+import { platformTools } from './tools/platform-tools.js';
|
|
|
+import { salaryTools } from './tools/salary-tools.js';
|
|
|
import { getApiClient } from './services/api-client.js';
|
|
|
|
|
|
// ============================================================================
|
|
|
@@ -58,55 +65,7 @@ function createMcpServer(): McpServer {
|
|
|
*/
|
|
|
function registerAllTools(targetServer: McpServer): void {
|
|
|
// Authentication tools
|
|
|
- registerToolWithAnnotations(
|
|
|
- authTools.login,
|
|
|
- { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
- 'Admin Login',
|
|
|
- `Authenticate with the admin backend using username and password.
|
|
|
-
|
|
|
-This tool establishes an authenticated session by logging in to the admin system.
|
|
|
-The authentication token is automatically stored and used for subsequent tool calls.
|
|
|
-
|
|
|
-Args:
|
|
|
- - username (string): Admin username
|
|
|
- - password (string): Admin password
|
|
|
-
|
|
|
-Returns:
|
|
|
- Authentication result with user information.
|
|
|
-
|
|
|
-Examples:
|
|
|
- - Use when: "Login to admin system" -> params with username="admin", password="password"
|
|
|
- - Use when: "I need to access the admin API" -> first call this tool
|
|
|
-
|
|
|
-Error Handling:
|
|
|
- - Returns "Error: Authentication failed" if credentials are invalid
|
|
|
- - Returns "Error: Cannot connect to API server" if backend is unreachable`,
|
|
|
- targetServer
|
|
|
- );
|
|
|
-
|
|
|
- registerToolWithAnnotations(
|
|
|
- authTools.logout,
|
|
|
- { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
- 'Admin Logout',
|
|
|
- `Logout from the admin backend and clear the authentication token.
|
|
|
-
|
|
|
-This tool ends the current admin session by clearing the stored authentication token.
|
|
|
-Subsequent API calls will require re-authentication.
|
|
|
-
|
|
|
-Args:
|
|
|
- - None
|
|
|
-
|
|
|
-Returns:
|
|
|
- Logout confirmation message.
|
|
|
-
|
|
|
-Examples:
|
|
|
- - Use when: "Logout from admin system" or "End admin session"
|
|
|
-
|
|
|
-Error Handling:
|
|
|
- - Rarely fails, mainly for client-side issues`,
|
|
|
- targetServer
|
|
|
- );
|
|
|
-
|
|
|
+ // Note: Token is pre-configured via Authorization header, so only getCurrentUser is available
|
|
|
registerToolWithAnnotations(
|
|
|
authTools.getCurrentUser,
|
|
|
{ readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
@@ -116,6 +75,9 @@ Error Handling:
|
|
|
This tool returns details about the user that is currently logged in,
|
|
|
including their roles, permissions, and profile information.
|
|
|
|
|
|
+Note: Authentication is handled via Authorization header. This tool only
|
|
|
+verifies the current token and returns user information.
|
|
|
+
|
|
|
Args:
|
|
|
- None
|
|
|
|
|
|
@@ -127,7 +89,7 @@ Examples:
|
|
|
- Use when: "Check my admin permissions"
|
|
|
|
|
|
Error Handling:
|
|
|
- - Returns "Error: Authentication failed" if not logged in`,
|
|
|
+ - Returns "Error: Authentication failed" if token is invalid`,
|
|
|
targetServer
|
|
|
);
|
|
|
|
|
|
@@ -572,6 +534,74 @@ Returns:
|
|
|
Examples:
|
|
|
- Use when: "Get order with ID 12345" -> params with id=12345
|
|
|
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if order ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ orderTools.orderCreate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Create Order',
|
|
|
+ `Create a new order in the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - companyId (number): Company ID (required)
|
|
|
+ - platformId (number): Platform ID (optional)
|
|
|
+ - orderAmount (number): Order amount (required)
|
|
|
+ - userId (number): User ID (optional)
|
|
|
+ - deliveryAddressId (number): Delivery address ID (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Created order information with ID.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Create a new order" -> params with companyId=1, orderAmount=1000
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Data validation failed" if parameters are invalid`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ orderTools.orderUpdate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Update Order',
|
|
|
+ `Update an existing order.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Order ID to update (required)
|
|
|
+ - companyId (number): Company ID (optional)
|
|
|
+ - platformId (number): Platform ID (optional)
|
|
|
+ - orderAmount (number): Order amount (optional)
|
|
|
+ - status (string): Order status (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated order information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Update order 1" -> params with id=1, status="completed"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if order ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ orderTools.orderDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete Order',
|
|
|
+ `Delete an order by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Order ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete order with ID 1" -> params with id=1
|
|
|
+
|
|
|
Error Handling:
|
|
|
- Returns "Error: Resource not found" if order ID doesn't exist`,
|
|
|
targetServer
|
|
|
@@ -849,6 +879,744 @@ Error Handling:
|
|
|
- Returns "Error: Resource not found" if company ID doesn't exist`,
|
|
|
targetServer
|
|
|
);
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // File Management Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ fileTools.fileList,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'List Files',
|
|
|
+ `List and search files with pagination and filtering.
|
|
|
+
|
|
|
+This tool retrieves a paginated list of files from the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - page (number): Page number, starting from 1 (default: 1)
|
|
|
+ - pageSize (number): Number of items per page, 1-100 (default: 20)
|
|
|
+ - keyword (string): Optional search keyword
|
|
|
+ - sortBy (string): Optional field to sort by
|
|
|
+ - sortOrder (string): Sort direction: "ASC" or "DESC" (default: "DESC")
|
|
|
+ - filters (string): Optional filter conditions as JSON string
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Paginated list of files with total count.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "List all files" -> default parameters
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ fileTools.fileGet,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Get File by ID',
|
|
|
+ `Retrieve detailed information about a specific file by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): File ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Complete file information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Get file with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if file ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ fileTools.fileDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete File',
|
|
|
+ `Delete a file by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): File ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete file with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if file ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // Bank Name Management Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ bankNameTools.bankNameList,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'List Bank Names',
|
|
|
+ `List and search bank names with pagination.
|
|
|
+
|
|
|
+This tool retrieves a paginated list of bank names from the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - page (number): Page number, starting from 1 (default: 1)
|
|
|
+ - pageSize (number): Number of items per page, 1-100 (default: 20)
|
|
|
+ - keyword (string): Optional search keyword (optional)
|
|
|
+ - sortBy (string): Optional field to sort by (optional)
|
|
|
+ - sortOrder (string): Sort direction: "ASC" or "DESC" (default: "DESC")
|
|
|
+ - filters (string): Optional filter conditions as JSON string (optional)
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Paginated list of bank names with total count.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "List all bank names" -> default parameters
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ bankNameTools.bankNameGet,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Get Bank Name by ID',
|
|
|
+ `Retrieve detailed information about a specific bank name by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Bank name ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Complete bank name information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Get bank name with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if bank name ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ bankNameTools.bankNameCreate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Create Bank Name',
|
|
|
+ `Create a new bank name in the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - name (string): Bank name (required)
|
|
|
+ - code (string): Bank code (required)
|
|
|
+ - status (number): Status: 0 = disabled, 1 = enabled (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Created bank name information with ID.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Create a new bank name" -> params with name="ICBC", code="ICBC"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Data already exists" if bank name code is duplicated`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ bankNameTools.bankNameUpdate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Update Bank Name',
|
|
|
+ `Update an existing bank name.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Bank name ID to update (required)
|
|
|
+ - name (string): Bank name (optional)
|
|
|
+ - code (string): Bank code (optional)
|
|
|
+ - status (number): Status (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated bank name information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Update bank name 1 status" -> params with id=1, status=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if bank name ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ bankNameTools.bankNameDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete Bank Name',
|
|
|
+ `Delete a bank name by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Bank name ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete bank name with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if bank name ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // Channel Management Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ channelTools.channelList,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'List Channels',
|
|
|
+ `List and search channels with pagination.
|
|
|
+
|
|
|
+This tool retrieves a paginated list of channels from the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - skip (number): Skip records (default: 0)
|
|
|
+ - take (number): Take records, 1-100 (default: 20)
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Paginated list of channels with total count.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "List all channels" -> default parameters
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ channelTools.channelGet,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Get Channel by ID',
|
|
|
+ `Retrieve detailed information about a specific channel by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Channel ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Complete channel information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Get channel with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if channel ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ channelTools.channelCreate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Create Channel',
|
|
|
+ `Create a new channel in the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - channelName (string): Channel name (required)
|
|
|
+ - channelType (string): Channel type (optional)
|
|
|
+ - contactPerson (string): Contact person (optional)
|
|
|
+ - contactPhone (string): Contact phone (optional)
|
|
|
+ - description (string): Description (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Created channel information with ID.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Create a new channel" -> params with channelName="Online"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Data already exists" if channel name is duplicated`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ channelTools.channelUpdate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Update Channel',
|
|
|
+ `Update an existing channel.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Channel ID to update (required)
|
|
|
+ - channelName (string): Channel name (optional)
|
|
|
+ - channelType (string): Channel type (optional)
|
|
|
+ - contactPerson (string): Contact person (optional)
|
|
|
+ - contactPhone (string): Contact phone (optional)
|
|
|
+ - description (string): Description (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated channel information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Update channel 1" -> params with id=1, channelName="Online Store"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if channel ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ channelTools.channelDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete Channel',
|
|
|
+ `Delete a channel by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Channel ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete channel with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if channel ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // Disabled Person Management Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ disabilityTools.disabledPersonList,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'List Disabled Persons',
|
|
|
+ `List and search disabled persons with pagination.
|
|
|
+
|
|
|
+This tool retrieves a paginated list of disabled persons from the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - skip (number): Skip records (default: 0)
|
|
|
+ - take (number): Take records, 1-100 (default: 20)
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Paginated list of disabled persons with total count.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "List all disabled persons" -> default parameters
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ disabilityTools.disabledPersonGet,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Get Disabled Person by ID',
|
|
|
+ `Retrieve detailed information about a specific disabled person by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Disabled person ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Complete disabled person information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Get disabled person with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if disabled person ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ disabilityTools.disabledPersonCreate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Create Disabled Person',
|
|
|
+ `Create a new disabled person in the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - name (string): Name (required)
|
|
|
+ - idCard (string): ID Card number (required)
|
|
|
+ - disabilityCertNo (string): Disability certificate number (required)
|
|
|
+ - disabilityType (string): Disability type (optional)
|
|
|
+ - disabilityLevel (string): Disability level (optional)
|
|
|
+ - phone (string): Phone number (optional)
|
|
|
+ - gender (string): Gender (optional)
|
|
|
+ - city (string): City (optional)
|
|
|
+ - district (string): District (optional)
|
|
|
+ - companyId (number): Company ID (optional)
|
|
|
+ - platformId (number): Platform ID (optional)
|
|
|
+ - status (number): Status: 0 = disabled, 1 = enabled (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Created disabled person information with ID.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Create a new disabled person" -> params with name="John", idCard="...", disabilityCertNo="..."
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Data already exists" if ID card is duplicated`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ disabilityTools.disabledPersonUpdate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Update Disabled Person',
|
|
|
+ `Update an existing disabled person.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Disabled person ID to update (required)
|
|
|
+ - name (string): Name (optional)
|
|
|
+ - idCard (string): ID Card number (optional)
|
|
|
+ - disabilityCertNo (string): Disability certificate number (optional)
|
|
|
+ - disabilityType (string): Disability type (optional)
|
|
|
+ - disabilityLevel (string): Disability level (optional)
|
|
|
+ - phone (string): Phone number (optional)
|
|
|
+ - gender (string): Gender (optional)
|
|
|
+ - city (string): City (optional)
|
|
|
+ - district (string): District (optional)
|
|
|
+ - companyId (number): Company ID (optional)
|
|
|
+ - platformId (number): Platform ID (optional)
|
|
|
+ - status (number): Status (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated disabled person information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Update disabled person 1" -> params with id=1, name="John"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if disabled person ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ disabilityTools.disabledPersonDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete Disabled Person',
|
|
|
+ `Delete a disabled person by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Disabled person ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete disabled person with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if disabled person ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // Disability Company Query Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ disabilityCompanyTools.queryDisabilityCompany,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'Query Disabled Persons with Company',
|
|
|
+ `Query disabled persons with their company information using multiple filters.
|
|
|
+
|
|
|
+This is a read-only query tool for finding disabled persons and their associated companies.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - name (string): Person name for search (optional)
|
|
|
+ - idCard (string): ID Card number (optional)
|
|
|
+ - companyName (string): Company name (optional)
|
|
|
+ - gender (string): Gender (optional)
|
|
|
+ - disabilityType (string): Disability type (optional)
|
|
|
+ - disabilityLevel (string): Disability level (optional)
|
|
|
+ - minAge (number): Minimum age (optional)
|
|
|
+ - maxAge (number): Maximum age (optional)
|
|
|
+ - city (string): City (optional)
|
|
|
+ - district (string): District (optional)
|
|
|
+ - companyId (number): Company ID (optional)
|
|
|
+ - platformId (number): Platform ID (optional)
|
|
|
+ - skip (number): Skip records (default: 0)
|
|
|
+ - take (number): Take records, 1-100 (default: 20)
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Query results with matching disabled persons and their company information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Find disabled persons by company name" -> params with companyName="ABC Corp"
|
|
|
+ - Use when: "Query disabled persons in a city" -> params with city="Beijing"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // Platform Management Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ platformTools.platformList,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'List Platforms',
|
|
|
+ `List and search platforms with pagination.
|
|
|
+
|
|
|
+This tool retrieves a paginated list of platforms from the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - skip (number): Skip records (default: 0)
|
|
|
+ - take (number): Take records, 1-100 (default: 20)
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Paginated list of platforms with total count.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "List all platforms" -> default parameters
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ platformTools.platformGet,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Get Platform by ID',
|
|
|
+ `Retrieve detailed information about a specific platform by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Platform ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Complete platform information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Get platform with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if platform ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ platformTools.platformCreate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Create Platform',
|
|
|
+ `Create a new platform in the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - platformName (string): Platform name (required)
|
|
|
+ - contactPerson (string): Contact person (optional)
|
|
|
+ - contactPhone (string): Contact phone (optional)
|
|
|
+ - contactEmail (string): Contact email (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Created platform information with ID.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Create a new platform" -> params with platformName="New Platform"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Data already exists" if platform name is duplicated`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ platformTools.platformUpdate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Update Platform',
|
|
|
+ `Update an existing platform.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Platform ID to update (required)
|
|
|
+ - platformName (string): Platform name (optional)
|
|
|
+ - contactPerson (string): Contact person (optional)
|
|
|
+ - contactPhone (string): Contact phone (optional)
|
|
|
+ - contactEmail (string): Contact email (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated platform information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Update platform 1" -> params with id=1, platformName="Updated Name"
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if platform ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ platformTools.platformDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete Platform',
|
|
|
+ `Delete a platform by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Platform ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete platform with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if platform ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ platformTools.platformToggleStatus,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Toggle Platform Status',
|
|
|
+ `Toggle the status of a platform (enabled/disabled).
|
|
|
+
|
|
|
+This tool switches the platform status between enabled (1) and disabled (0).
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Platform ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated platform with new status.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Toggle platform 1 status" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if platform ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ // ============================================================================
|
|
|
+ // Salary Level Management Tools
|
|
|
+ // ============================================================================
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ salaryTools.salaryList,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
|
+ 'List Salary Levels',
|
|
|
+ `List and search salary levels with pagination.
|
|
|
+
|
|
|
+This tool retrieves a paginated list of salary levels from the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - skip (number): Skip records (default: 0)
|
|
|
+ - take (number): Take records, 1-100 (default: 20)
|
|
|
+ - response_format (string): Output format: "markdown" or "json" (default: "markdown")
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Paginated list of salary levels with total count.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "List all salary levels" -> default parameters
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Permission denied" if not authorized`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ salaryTools.salaryGet,
|
|
|
+ { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Get Salary Level by ID',
|
|
|
+ `Retrieve detailed information about a specific salary level by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Salary level ID (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Complete salary level information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Get salary level with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if salary level ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ salaryTools.salaryCreate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Create Salary Level',
|
|
|
+ `Create a new salary level in the admin system.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - provinceId (number): Province ID (optional)
|
|
|
+ - cityId (number): City ID (optional)
|
|
|
+ - districtId (number): District ID (optional)
|
|
|
+ - baseSalary (number): Base salary (optional)
|
|
|
+ - allowance (number): Allowance (optional)
|
|
|
+ - insurance (number): Insurance (optional)
|
|
|
+ - providentFund (number): Provident fund (optional)
|
|
|
+ - totalSalary (number): Total salary (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Created salary level information with ID.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Create a new salary level" -> params with baseSalary=5000, totalSalary=6000
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Data already exists" if salary level for location exists`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ salaryTools.salaryUpdate,
|
|
|
+ { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
|
+ 'Update Salary Level',
|
|
|
+ `Update an existing salary level.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Salary level ID to update (required)
|
|
|
+ - provinceId (number): Province ID (optional)
|
|
|
+ - cityId (number): City ID (optional)
|
|
|
+ - districtId (number): District ID (optional)
|
|
|
+ - baseSalary (number): Base salary (optional)
|
|
|
+ - allowance (number): Allowance (optional)
|
|
|
+ - insurance (number): Insurance (optional)
|
|
|
+ - providentFund (number): Provident fund (optional)
|
|
|
+ - totalSalary (number): Total salary (optional)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Updated salary level information.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Update salary level 1" -> params with id=1, baseSalary=5500
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if salary level ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
+
|
|
|
+ registerToolWithAnnotations(
|
|
|
+ salaryTools.salaryDelete,
|
|
|
+ { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
|
+ 'Delete Salary Level',
|
|
|
+ `Delete a salary level by ID.
|
|
|
+
|
|
|
+Args:
|
|
|
+ - id (number): Salary level ID to delete (required)
|
|
|
+
|
|
|
+Returns:
|
|
|
+ Deletion confirmation.
|
|
|
+
|
|
|
+Examples:
|
|
|
+ - Use when: "Delete salary level with ID 1" -> params with id=1
|
|
|
+
|
|
|
+Error Handling:
|
|
|
+ - Returns "Error: Resource not found" if salary level ID doesn't exist`,
|
|
|
+ targetServer
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
// ============================================================================
|