uchenily commented on PR #36:
URL: https://github.com/apache/doris-mcp-server/pull/36#issuecomment-3153010573

   You are right, I also believe that there is a problem of functional overlap 
in the implementation at that time:
      - `get_table_schema`: Provides column structure, types, and comments
      - `get_table_summary`: Provides table metadata and optional sample data
   
   The sample output of `get_table_schema`:
   ```json
   {
     "success": true,
     "timestamp": "2025-08-05 09:18:19",
     "result": [
       {
         "column_name": "user_id",
         "data_type": "bigint",
         "is_nullable": false,
         "default_value": null,
         "comment": "",
         "key": "true",
         "extra": ""
       },
       {
         "column_name": "name",
         "data_type": "varchar(20)",
         "is_nullable": false,
         "default_value": null,
         "comment": "",
         "key": "false",
         "extra": "NONE"
       },
       {
         "column_name": "age",
         "data_type": "int",
         "is_nullable": false,
         "default_value": null,
         "comment": "",
         "key": "false",
         "extra": "NONE"
       }
     ],
     "message": "Operation successful",
     "_execution_info": {
       "tool_name": "get_table_schema",
       "execution_time": 0.007,
       "timestamp": "2025-08-05T09:18:19.837167"
     }
   }
   ```
   
   the sample output of `get_table_summary`:
   
   ```json
   {
     "table_name": "test_streamload",
     "comment": "",
     "row_count": 10,
     "create_time": "2025-08-04 09:29:58",
     "engine": "Doris",
     "column_count": 3,
     "columns": [
       {
         "column_name": "user_id",
         "data_type": "bigint",
         "is_nullable": "NO",
         "column_key": "DUP",
         "column_comment": "用户 ID"
       },
       {
         "column_name": "name",
         "data_type": "varchar",
         "is_nullable": "YES",
         "column_key": "",
         "column_comment": "用户姓名"
       },
       {
         "column_name": "age",
         "data_type": "int",
         "is_nullable": "YES",
         "column_key": "",
         "column_comment": "用户年龄"
       }
     ],
     "sample_data": [
       {
         "user_id": 2,
         "name": "Benjamin",
         "age": 35
       },
       {
         "user_id": 3,
         "name": "Olivia",
         "age": 28
       }
     ],
     "_execution_info": {
       "tool_name": "get_table_summary",
       "execution_time": 0.218,
       "timestamp": "2025-08-05T09:29:47.557253"
     }
   }
   ```
   
   Based on the above information and your suggestions, here I have a simple 
solution:
   
   
   ## Tool Proposal: get_table_information
   
   
   ### Parameters
   | Parameter | Type | Required | Default | Description |
   |-----------|------|----------|---------|-------------|
   | table_name | string | Yes | - | Name of the table to analyze |
   | db_name | string | No | Current DB | Target database name |
   | include_schema | boolean | No | true | Whether to include schema 
information (columns, types, comments) |
   | include_sample | boolean | No | false | Whether to include sample data 
rows |
   | sample_size | integer | No | 3 | Number of sample rows to return when 
include_sample=true |
   
   ### Response Structure
   ```json
   {
     "basic_info": {
       "table_name": "string",
       "db_name": "string",
       "row_count": "number",
       "comment": "string"
     },
     "columns": [
       {
         "name": "string",
         "type": "string",
         "comment": "string",
         "is_nullable": "boolean"
       }
     ],
     "sample_data": [
       {
         // sample rows
       }
     ]
   }
   ```
   
   What do you think of this proposal? @FreeOnePlus 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to