Content
# MCP Civil Tools Server
This project is a Python server based on the MCP protocol. It primarily provides the technical specifications for soil and water conservation (2023.05.04) through the MCP Server, allowing MCP-enabled clients to call upon it. This enables querying and calculations through natural language conversations with large models, offering functionalities such as Manning's coefficient lookup, earth pressure coefficients, drainage ditch flow velocity, slope stability, soil erosion, runoff, retaining wall checks, vegetation recommendations, material parameters, slope protection, infiltration facilities, IDF curves, and more. Additionally, it provides conversion between latitude/longitude and UTM/TWD97 coordinates for Taiwan. It is suitable for integration with LLM tools, Claude Desktop, and other AI applications.
Note: The program is not yet complete, and the intelligence of each large model varies. Users must verify the output results again. If there are any errors, feedback is welcome!
---
## Table of Contents
```
MCP-civil-tools/
├── src/
│ ├── mcp_server.py # MCP Server main program
│ ├── util.py # Coordinate conversion and civil engineering tool logic
│ └── utm_types/
│ └── __init__.py # Type definitions
├── requirements.txt # Dependency packages
├── README.md # Project description
└── .gitignore # Git ignore rules
```
---
## Installation
1. It is recommended to create a virtual environment first:
```bash
python -m venv .venv
.venv\Scripts\activate # Windows
# 或 source .venv/bin/activate # Linux/macOS
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
---
## Startup Methods
### 1. CLI (stdio) Mode
```bash
python src/mcp_server.py
```
### 2. HTTP Service Mode (Recommended for API testing or HTTP integration)
```bash
uvicorn src.mcp_server:app --port 8000
```
---
## mcp.json Configuration Example
To allow Claude Desktop or other MCP clients to automatically detect and start this server, the MCP setting JSON content is as follows (please adjust according to the actual path):
```json
{
"mcpServers": {
"MCP-civil-tools": {
"command": "path/.venv/Scripts/python.exe",
"args": [
"path/src/mcp_server.py"
]
}
}
}
or
"MCP-civil-tools": {
"command": "C:/TOMO/MCP-civil-tools/.venv/Scripts/python.exe",
"args": [
"C:/TOMO/MCP-civil-tools/src/mcp_server.py"
],
"disabled": true,
"autoApprove": []
},
```
- `command` Please fill in the absolute path of your virtual environment's python.exe.
- `args` Please fill in the absolute path of mcp_server.py.
For Windows systems, the Command args input format is as follows:
C:\TOMO\MCP-civil-tools\.venv\Scripts\python.exe C:\TOMO\MCP-civil-tools\src\mcp_server.py
For MAC systems, the Command args input format is as follows:
/Users/tuchengshin/Documents/MCP/MCP-civil-tools/.venv/bin/python3
/Users/tuchengshin/Documents/MCP/MCP-civil-tools/src/mcp_server.py
---
## Parameter Default Behavior Description
- When the user only enters latitude and longitude without other information, the default UTM/TM2 Zone is TM2-121, and the default hemisphere is the Northern Hemisphere.
- When the user only enters plane coordinates X, Y, the default UTM Zone is TWD97, and the hemisphere is the Northern Hemisphere.
---
## Main Feature Updates
- **All table-lookup tools now support the "Support List Query" API**:
- For example: `list_supported_materials` (common materials), `list_supported_manning_materials` (Manning's coefficient materials), `list_supported_max_velocity_materials` (maximum velocity materials), `list_supported_regions` (regions/IDF/annual rainfall), `list_supported_soil_types` (soil types), `list_supported_land_uses` (land uses), `list_supported_practices` (water conservation practices), `list_supported_runoff_land_uses` (runoff coefficient land uses), `list_supported_slope_protection_methods` (slope protection methods), `list_supported_soil_k_types` (permeability coefficient soils), `list_supported_idf_locations` (IDF curve locations), etc.
- If an error is entered or no data is found during the query, all supported items that can be queried will be automatically prompted, improving the user experience.
- **2023/04/23 Update**:
- Fixed the `list_supported_materials` function, which now correctly returns a list of all supported common material design parameter material names, including: general clay, sand, gravel, concrete, granite, limestone, shale, sandstone, etc.
- Added four USLE factor query tools:
- `query_r_factor_tool`: Query rainfall erosivity index R value (according to Soil and Water Conservation Technical Specifications Article 35)
- `query_k_factor_tool`: Query soil erodibility index K value (according to Soil and Water Conservation Technical Specifications Article 35)
- `query_c_factor_tool`: Query cover and management factor C value (according to Soil and Water Conservation Technical Specifications Article 35)
- `query_p_factor_tool`: Query soil and water conservation treatment factor P value (according to Soil and Water Conservation Technical Specifications Article 35)
- Fixed the `calc_catchment_runoff` function, enhanced parameter processing capabilities, and can now correctly process natural language input, such as "Calculate the maximum runoff of a catchment area of 2 hectares, rainfall intensity of 100mm/hr, and runoff coefficient of 0.6".
- Expanded the `check_retaining_wall` function, adding safety factor checks under seismic conditions:
- According to Article 120 of the Soil and Water Conservation Technical Specifications, added checks for sliding safety factor (≧1.2) and overturning safety factor (≧1.5) during earthquakes
- Added check for the location of the resultant force application point, supporting both bedrock foundation and soil foundation conditions
- Corrected the bearing capacity safety factor requirement to 3.0, in accordance with regulatory requirements
- Clearly distinguish between safety factors under normal conditions and seismic conditions in the output report
---
## Individual Tool Usage Examples
### Latitude and Longitude to UTM
- Input: Natural language description of latitude and longitude, such as "Convert latitude 24.125 and longitude 120.641 to UTM coordinates"
- Return: `"X,Y"` string, numerical values rounded to 4 decimal places
#### Example
```
Input: Please convert latitude 24.125193616011536 and longitude 120.64098341751337 to UTM coordinates
Return: 203650.6040,2670482.4250
```
### UTM to Latitude and Longitude
- Input: X, Y coordinates (optional zone, datum, south, default TWD97 Northern Hemisphere)
- Return: `"latitude,longitude"` string, numerical values rounded to 15 decimal places
#### Example
```
Input: Please convert UTM coordinates X=203650.604 and Y=2670482.425 to latitude and longitude
Return: 24.125193616011536,120.64098341751337
```
### Manning's Coefficient Query
- Input: Material name (such as "concrete", "pure fine sand", "fully dense grass", etc.)
- Return: Manning's coefficient n and maximum allowable flow velocity range for the material
#### Example
```
Input: What is the Manning's coefficient of fully dense grass?
Return: The Manning's coefficient n for fully dense grass is 0.040, and the maximum allowable flow velocity range is: 1.5~2.5 m/s
Based on: Article 18 and appendix of the Soil and Water Conservation Technical Specifications Manning's coefficient table
Input: Please query the Manning's coefficient of concrete
Return: The Manning's coefficient n for concrete is 0.013, and the maximum allowable flow velocity range is: 3.0~6.0 m/s
Based on: Article 18 and appendix of the Soil and Water Conservation Technical Specifications Manning's coefficient table
```
### Active Earth Pressure Coefficient Calculation
- Input: Information such as internal friction angle
- Return: Active earth pressure coefficient Ka, calculation formula, basis, etc.
#### Example
```
Input: What is the active earth pressure coefficient Ka for an internal friction angle of 30 degrees?
Return: Active earth pressure coefficient Ka = 0.3333
Based on: Article 117 and appendix of the Soil and Water Conservation Technical Specifications Earth pressure calculation formula
Description: The active earth pressure coefficient is used to calculate the horizontal thrust borne by the retaining structure and is an important parameter in retaining wall design.
```
### Passive Earth Pressure Coefficient Calculation
- Input: Information such as internal friction angle
- Return: Passive earth pressure coefficient Kp, calculation formula, basis, etc.
#### Example
```
Input: What is the passive earth pressure coefficient Kp for an internal friction angle of 30 degrees?
Return: Passive earth pressure coefficient Kp = 3.0
Based on: Article 117 and appendix of the Soil and Water Conservation Technical Specifications Earth pressure calculation formula
Description: The passive earth pressure coefficient is used to calculate the resistance of the retaining structure and is an important parameter in retaining wall stability analysis.
```
### Drainage Section Velocity/Depth/Flow Calculation (Multi-Section Support)
- Input: Section type, flow rate, slope, Manning's coefficient, channel material, dimensions, and other information
- Return: Calculation results for flow velocity, flow depth, cross-sectional area, hydraulic radius, etc., as well as a complete report
#### Calculation Logic and Warning Description (2024/06 Revised Edition)
- If the input flow rate exceeds the maximum flow rate when the section is full, the system will directly return an error message, prompting "The required flow rate has exceeded the maximum full flow rate, please increase the size or slope".
- As long as the flow rate does not exceed the full flow, the calculation will automatically obtain a reasonable flow depth (less than the ditch height) and will not falsely report full flow.
- Full flow warnings only appear when the flow depth is very close to the height and the flow rate is very close to the full flow.
- The calculation accuracy and convergence conditions have been optimized to avoid misjudgment in commonly used engineering scenarios.
#### Maximum/Minimum Allowable Velocity Rules
- Maximum Allowable Velocity:
- Only the maximum value is checked (such as concrete 6.1m/s, reinforced concrete 12.0m/s, coarse and fine sand 0.61m/s, etc.). If exceeded, the system will warn and recommend the installation of energy dissipation facilities.
- There is no maximum allowable flow velocity for "reinforced concrete" in the table, and the system has added a maximum value of 12.0m/s.
- Minimum Allowable Velocity:
- Only concrete and reinforced concrete drainage facilities clearly stipulate that the minimum allowable flow velocity is 0.8 m/s. If it is lower than this, the system will warn that it may lead to siltation.
- There are no clear regulations for other materials, and the system does not check the minimum value.
- Inspection Recommendation: If the designed drainage velocity exceeds its maximum allowable velocity, energy dissipation facilities should be installed at appropriate locations.
#### Water Outlet Height (Flow Depth) Specification Check (Article 86)
- The water outlet height (flow depth) of rectangular and trapezoidal drainage ditches should meet the following:
- Not less than 25% of the design water depth
- The minimum value is 20 cm
- L-shaped and parabolic drainage ditches are not subject to this restriction
- If the calculated flow depth is lower than the above standards, the system will give a clear warning in the returned results and report, please adjust the design parameters.
#### Example
```
Input: Calculate the flow velocity and flow depth of a reinforced concrete rectangular ditch with a width of 50 cm, a height of 70 cm, a flow rate of 1 cms, and a slope of 5%? Output a complete report, including the calculation process and calculation formula.
Return:
Flow velocity: 7.20 m/s, flow depth: 0.250 m. Warning: The calculated flow velocity v = 7.2000 m/s has exceeded the maximum allowable flow velocity of 'reinforced concrete' 12.0 m/s, and energy dissipation facilities should be installed at appropriate locations.
Input: Calculate the flow velocity and flow depth of a concrete rectangular ditch with a width of 50 cm, a height of 70 cm, a flow rate of 0.2 cms, and a slope of 0.5%?
Return:
Flow velocity: 0.65 m/s, flow depth: 0.120 m. Warning: The calculated flow velocity v = 0.6500 m/s is lower than the minimum allowable flow velocity of 'concrete' 0.8 m/s, which may lead to siltation.
[Drainage Section Velocity/Depth/Flow Calculation Report]
Section Type: Rectangular
Rectangular bottom width b=50.0cm, height h=70.0cm
Flow rate Q = 1.000 cms
Slope S = 5.000%
Manning's coefficient n = 0.013
Channel Material: Reinforced Concrete
[Calculation Formula]
Q = A × V, V = (1/n) × R^(2/3) × S^(1/2)
[Calculation Steps]
A = b×y, P = b+2y, R = A/P, V = (1/n)R^(2/3)S^(1/2), Q = A×V
[Calculation Results]
Flow velocity V = 2.340 m/s
Flow depth y = 0.210 m
Cross-sectional area A = 0.1050 m²
Hydraulic radius R = 0.0700 m
Perimeter P = 1.0000 m
The calculation results meet the safe flow velocity specifications.
[Inspection Warning] The calculated flow depth y = 0.210 m does not meet the specifications of Article 86 and should be ≧max(0.2m, 25% of the design water depth)=0.250 m. Please adjust the design.
```
### Slope Stability Safety Factor Calculation
- Input: Information such as slope, unit weight, friction angle, cohesion, groundwater level, method, etc.
- Return: Safety factor, method, whether it is qualified, description
#### Example
```
Input: Please calculate the slope stability safety factor for a slope with a slope of 30 degrees, a soil unit weight of 18kN/m³, a friction angle of 30 degrees, and a cohesion of 10kPa
Return: Safety factor = 1.50, Method: Simplified method, Qualified: True
Based on: Article 31 and appendix of the Soil and Water Conservation Technical Specifications Safety factor table
Description: The slope stability safety factor should be greater than 1.5, and this case meets the regulatory requirements.
```
### Soil Erosion Modulus/Loss Calculation
- Input: Information such as slope length, slope, rainfall, soil type, land use, water conservation measures, etc.
- Return: Erosion modulus, loss, method, description
#### Example
```
Input: Calculate the soil loss for a slope with a slope length of 100 meters, a slope of 10%, an annual rainfall of 1200mm, sandy soil, grassland, and contour cultivation
Return: Soil erosion modulus/loss = 42.75 tons/hectare/year
Based on: Article 35 and appendix of the Soil and Water Conservation Technical Specifications USLE formula, parameter table
Description: The USLE formula is an internationally used method for estimating soil loss, and Taiwan's soil and water conservation regulations stipulate that it can be used for slope soil erosion assessment.
```
### Catchment Maximum Runoff Calculation
- Input: Information such as catchment area, rainfall intensity, runoff coefficient, etc.
- Return: Maximum runoff, method, description
#### Example
```
Input: Calculate the maximum runoff for a catchment area of 2 hectares, a rainfall intensity of 100mm/hr, and a runoff coefficient of 0.6
Return: Maximum runoff Q = 0.33 cms, Method: Rational
Based on: Articles 16, 17, 18 and appendix of the Soil and Water Conservation Technical Specifications Rainfall intensity, runoff coefficient table
Description: When the catchment area is less than 1000 hectares, the Rational formula can be used to calculate the peak flow without measured data.
```
### Revetment/Retaining Wall Stability Check
- Input: Wall height, thickness (rectangular section) or top width/bottom width (trapezoidal section), unit weight, friction angle, cohesion, backfill slope, groundwater level, seismic coefficient, foundation type, and other information
- Return: Sliding and overturning safety factors under normal and seismic conditions, location of the resultant force application point, whether it is qualified, description
#### Example (Rectangular Section)
```
Input: Check a retaining wall with a height of 2 meters and a thickness of 1 meter, soil unit weight of 18kN/m³, friction angle of 30 degrees, cohesion of 10kPa, backfill slope of 10 degrees, seismic coefficient of 0.15, and soil foundation
Return:
[Normal Conditions]
Sliding SF=1.65 (≧1.5 Qualified), Overturning SF=2.30 (≧2.0 Qualified), Bearing SF=3.10 (≧3.0 Qualified), Resultant force application point location qualified
[Seismic Conditions]
Sliding SF=1.25 (≧1.2 Qualified), Overturning SF=1.60 (≧1.5 Qualified), Resultant force application point location qualified
Based on: Articles 117, 118, 120, 164 and appendix of the Soil and Water Conservation Technical Specifications Minimum safety factor table
Description: Retaining wall design must simultaneously check the sliding and overturning safety factors and the location of the resultant force application point under normal and seismic conditions, and meet the recommended standards of the specifications.
```
#### Example (Trapezoidal Section)
```
Input: Check a trapezoidal retaining wall with a height of 2 meters, a top width of 0.5 meters, and a bottom width of 1 meter, soil unit weight of 18kN/m³, friction angle of 30 degrees, cohesion of 10kPa, seismic coefficient of 0.15, and soil foundation
Return:
[Wall Geometry and Weight]
Trapezoidal Section: Height = 2.00 m, Top Width = 0.50 m, Bottom Width = 1.00 m, Wall Unit Weight = 24.00 kN/m³
Wall Weight W = 24.00 × (1.00 + 0.50) × 2.00 / 2 = 36.00 kN/m
Center of Gravity Location x_g = 0.56 m
[Normal Conditions]
Sliding SF=1.78 (≧1.5 Qualified), Overturning SF=2.45 (≧2.0 Qualified), Bearing SF=3.25 (≧3.0 Qualified), Resultant force application point location qualified
[Seismic Conditions]
Sliding SF=1.32 (≧1.2 Qualified), Overturning SF=1.75 (≧1.5 Qualified), Resultant force application point location qualified
Based on: Articles 117, 118, 120, 164 and appendix of the Soil and Water Conservation Technical Specifications Minimum safety factor table
Description: Retaining wall design must simultaneously check the sliding and overturning safety factors and the location of the resultant force application point under normal and seismic conditions, and meet the recommended standards of the specifications.
```
### Vegetation Slope Protection Design Recommendations
- Input: Information such as slope, soil type, climate, etc.
- Return: Recommended construction method, grass species, coverage rate, description
#### Example
```
Input: Please provide vegetation slope protection design recommendations for a slope with a slope of 30 degrees, loam, and a subtropical climate
Return: Recommended construction method: Hydroseeding + grid frame or geotextile, phased construction by zone
Grass species: Bermuda grass, Cynodon dactylon, carpet grass and other drought-resistant and erosion-resistant grass species
Coverage rate: 90.0%
Based on: Articles 8, 167, 172 and appendix of the Soil and Water Conservation Technical Specifications Slope classification, sample area, coverage rate and other regulations
```
### Common Material Design Parameter Query
- Input: Material name
- Return: Unit weight, cohesion, friction angle, strength, description
#### Example
```
Input: Please provide the design parameters for general clay
Return: Material: General Clay, Unit Weight: 18.0kN/m³, Cohesion: 20.0kPa, Friction Angle: 25.0°, Strength: 200.0kPa
Based on: Common Soil Engineering Handbook
```
### Slope Protection Method Recommendations
- Input: Information such as slope, soil type, rainfall, etc.
- Return: Recommended construction method, description
#### Example
```
Input: What protection method is recommended for a slope with a slope of 30%, sandy soil, and an annual rainfall of 1200mm?
Return: Recommended construction method: Hydroseeding + grid frame or geotextile
Description: Drainage facilities and slope stabilization measures should be strengthened when the slope is large
Based on: Articles 8, 167, 172 and appendix of the Soil and Water Conservation Technical Specifications Slope classification table
```
### Infiltration Facility Design
- Input: Information such as facility type, soil permeability coefficient, catchment area, rainfall, etc.
- Return: Design flow, recommended size, description
#### Example
```
Input: Please design an infiltration well with a soil permeability coefficient k=0.001cm/s, a catchment area of 100 square meters, and an annual rainfall of 1200mm
Return: Facility type: Infiltration Well, Design Flow: 0.033cms, Recommended Size: Diameter 1.2m, Depth 1.8m
Based on: Article 94 and appendix of the Soil and Water Conservation Technical Specifications Infiltration facility design guidelines
Description: Infiltration well design needs to consider soil permeability, catchment area and local rainfall characteristics, and be regularly maintained to ensure function.
```
### IDF Curve Query
- Input: Information such as location, return period, duration, etc.
- Return: Rainfall intensity, description
#### Example
```
Input: Please query the rainfall intensity for Taichung City with a 10-year return period and a 60-minute duration
Return: Location: Taichung City, Return Period: 10 years, Duration: 60 minutes, Intensity: 78.5 mm/hr
Based on: Article 15 and appendix of the Soil and Water Conservation Technical Specifications IDF curve formula
Description: The IDF curve reflects the rainfall intensity under different return periods and durations and is used for hydrological analysis and hydraulic facility design.
```
### Query Support List
- You can directly query which available materials, regions, construction methods, etc. are available:
```
Query: What are the common materials?
Return: ['General Clay', 'Sand', 'Gravel', 'Concrete', ...]
Query: Which Manning's coefficients for ditch pavement can be queried?
Return: ['Pure Fine Sand', 'Concrete', 'Fully Dense Grass', ...]
Query: What are the slope protection methods?
Return: ['Turf or Direct Seeding', 'Hydroseeding + Grid Frame/Geotextile', ...]
Query: Which IDF locations are available?
Return: ['Taipei City', 'New Taipei City', 'Taichung City']
```
### Automatic Prompting When Query Fails
- If an error is entered during the query, all supported query items will be automatically returned:
```
Input: Query a non-existent material name
Return: No such material was found. Supported query materials are: General Clay, Sand, Gravel, Concrete, ...
```
## Gabion Retaining Wall Stability Analysis
This function is used to analyze the stability of gabion retaining walls, including active and passive earth pressure calculations.
### Usage
```python
result = check_gabion_stability(
height=3.0, # Gabion height (m)
width=2.0, # Gabion width (m)
wall_weight=100, # Total retaining wall weight (kN/m)
phi=30, # Soil internal friction angle (°)
delta=20, # Wall friction angle (°), default 0
theta=0, # Wall inclination angle (°), default 0
i=0, # Ground surface inclination angle (°), default 0
gamma=18, # Soil saturated unit weight (kN/m³), default 18
friction_coef=0.5, # Friction coefficient, default 0.5
pressure_mode="active" # Earth pressure mode ("active" or "passive"), default "active"
)
```
### Return Value
The function returns a dictionary containing the following:
- `success`: Boolean value indicating whether the calculation was successful
- `data`: Calculation result data, including:
- `earth_pressure_coef`: Earth pressure coefficient
- `total_pressure`: Total earth pressure (kN/m)
- `vertical_force`: Vertical force component (kN/m)
- `horizontal_force`: Horizontal force component (kN/m)
- `restoring_moment`: Restoring moment (kN·m/m)
- `overturning_moment`: Overturning moment (kN·m/m)
- `overturning_safety_factor`: Overturning safety factor
- `sliding_safety_factor`: Sliding safety factor
- `message`: Calculation result summary
- `report`: Complete calculation report (Markdown format)
### Calculation Report Content
The report includes the following sections:
1. Input Parameters
2. Calculation Formulas
3. Calculation Results
4. Stability Assessment
### U-Shaped Channel Reinforcement Calculation
- Input:
- height: Channel height (m)
- wall_slope: Channel wall slope (m)
- soil_slope: Soil slope (°)
- soil_angle: Angle of repose (°)
- effective_depth: Effective depth (m)
- soil_weight: Soil weight (kN/m³), default 18.0
- Return: dict, including calculation results and report
#### Example
```
Input: Concrete channel, height=1.5, wall_slope=0.5, soil_slope=15, soil_angle=30, effective_depth=0.2, calculate the required reinforcement for the channel, what is the recommended reinforcement?
Return:
{
"success": true,
"data": {
"earth_pressure_coef": 0.3333,
"earth_pressure": 6.750,
"moment": 3.375,
"rebar_area": 13.780
},
"message": "Earth pressure coefficient Ka = 0.3333, Earth pressure P = 6.750 kN/m, Bending moment M = 3.375 kN·m/m, Reinforcement As = 13.780 cm²/m",
"report": "【U-Shaped Channel Reinforcement Calculation Report】\n\nInput Parameters:\n- Channel height H = 1.500 m\n- Channel wall slope m = 0.500\n- Soil slope i = 15.00°\n- Angle of repose ψ = 30.00°\n- Effective depth d = 0.200 m\n- Soil weight γ = 18.0 kN/m³\n\nCalculation Formulas:\n1. Earth pressure coefficient Ka = cos²(ψ+m) / [cos²m·(1+√Q)²]\n where Q = [sinψ·sin(ψ-i)] / [cos(m+i)·cosm]\n2. Earth pressure P = γ·H²·Ka / (2·cosm)\n3. Bending moment M = γ·H³·Ka / (6·cosm)\n4. Reinforcement As = M / (fs·d) × 10⁶ / 1000\n\nCalculation Results:\n- Earth pressure coefficient Ka = 0.3333\n- Earth pressure P = 6.750 kN/m\n- Bending moment M = 3.375 kN·m/m\n- Reinforcement As = 13.780 cm²/m"
}
```
## Rebar Query Function
This tool provides the following rebar data query functions:
1. List all available rebar numbers
```python
list_rebar_numbers()
```
2. Query specification data for a specific rebar number
```python
get_rebar_specs(rebar_number="#3")
```
3. Calculate rebar weight
```python
calculate_rebar_weight(rebar_number="#3", length=10.0)
```
Available rebar numbers include: #3, #4, #5, #6, #7, #8, #9, #10, #11. The specification data corresponding to each number includes:
- Diameter (mm)
- Cross-sectional area (cm²)
- Unit weight (kg/m)
- Perimeter (mm)
### Rebar Specification Query
Enter "Rebar Specification #3" or "Rebar Data #3" to query detailed data for a specific rebar, including:
- Rebar number
- Diameter (mm)
- Cross-sectional area (cm²)
- Unit weight (kg/m)
- Perimeter (mm)
### Rebar Weight Calculation
Enter "Rebar Weight Length 6 #3" to calculate the weight of a rebar of a specified length, for example:
- Length: 6m
- Rebar: #3
- Weight: 2.04 kg
### Rebar Cross-Sectional Area Query
Enter "Rebar Cross-Sectional Area #3" to query the cross-sectional area of a specific rebar, for example:
- #3 Rebar cross-sectional area: 0.71 cm²
### All Rebar List
Enter "All Rebar" to list all available rebar numbers, including:
- #3 to #11 rebar
- Basic specifications of each rebar
### U-Shaped Channel Reinforcement Recommendations
Enter "U-Shaped Channel Reinforcement Area 10cm2" to query recommended reinforcement methods. The system will:
1. Based on the input rebar cross-sectional area (cm²/m)
2. Automatically calculate and recommend the reinforcement method for main and secondary rebars
3. The spacing will be rounded to the nearest 5cm
4. Provide a complete reinforcement recommendation report
### Runoff Coefficient Query
The runoff coefficient query tool can query the runoff coefficient C value for different land use types or watershed conditions according to Article 18 of the Soil and Water Conservation Technical Specifications.
#### Example
```
Input: Please query the runoff coefficient for agricultural areas
Return: Runoff coefficient C = 0.53
Source: Agricultural area runoff coefficient range: 0.45~0.60, using the average value of 0.53
Based on: Article 18 and Annex Runoff Coefficient Table of the Soil and Water Conservation Technical Specifications
Explanation: The runoff coefficient C value reflects the impact of watershed surface characteristics on rainfall runoff. The C value in the developing state is calculated as 1.0.
Input: What is the runoff coefficient for flat cultivated land under development?
Return: Runoff coefficient C = 0.85
Source: Under development, flat cultivated land
Based on: Article 18 and Annex Runoff Coefficient Table of the Soil and Water Conservation Technical Specifications
Explanation: The runoff coefficient C value reflects the impact of watershed surface characteristics on rainfall runoff. The C value is higher in the developing state.
```
The query results include:
- Runoff coefficient value
- Source description
- Specification basis
- Land use type
- Development status
- Numerical range (if applicable)
### USLE Factor Query Tool
The USLE factor query tool can query the factor values required for soil loss calculation according to Article 35 of the Soil and Water Conservation Technical Specifications.
#### Rainfall Erosivity Index R Value Query
```
Input: Please query the rainfall erosivity index R value for Taipei City
Return: The rainfall erosivity index R for the Taipei City area is 350, unit: MJ·mm/ha·hr·year
Input: What is the rainfall erosivity index R value for an average annual rainfall of 2000mm?
Return: The rainfall erosivity index R estimated from the average annual rainfall of 2000 mm is 600, unit: MJ·mm/ha·hr·year
```
#### Soil Erodibility Index K Value Query
```
Input: What is the erodibility index K value for sandy soil?
Return: The erodibility index K for the soil type sandy soil is 0.30, unit: t·ha·yr/ha·MJ·mm
Input: Please query the K value for clay
Return: The erodibility index K for the soil type clay is 0.20, unit: t·ha·yr/ha·MJ·mm
```
#### Cover and Management Factor C Value Query
```
Input: What is the cover and management factor C value for grassland?
Return: The cover and management factor C for the land use type grassland is 0.05, unit: dimensionless
Input: Please query the C value for farmland
Return: The cover and management factor C for the land use type farmland is 0.30, unit: dimensionless
```
#### Soil and Water Conservation Treatment Factor P Value Query
```
Input: What is the soil and water conservation treatment factor P value for contour cultivation?
Return: The treatment factor P for the soil and water conservation measure contour cultivation is 0.50, unit: dimensionless
Input: Please query the P value for terraces
Return: The treatment factor P for the soil and water conservation measure terraces is 0.20, unit: dimensionless
```
The query results include:
- Factor value
- Unit
- Source description
- Specification basis
## Usage Examples (Function-oriented, using natural language dialogue to allow the large model to automatically call relevant tools to solve problems)
- A watershed area is about 5ha, flat cultivated land, New Taipei City, return period 50 years, rainfall duration 60min, call the tool to obtain the rainfall intensity value of the area, calculate the maximum runoff of the watershed?
- A watershed area is about 5ha, flat cultivated land, New Taipei City, rainfall duration 60min, call the tool to obtain the rainfall intensity value of the area, please calculate the maximum runoff of the watershed for return periods of 25 years and 50 years respectively? And output a complete calculation formula report.
- Based on the 25-year runoff, design a concrete channel with a width of 50cm and a depth of 70cm, what is the allowable range of the design slope?
- Based on this runoff, design a concrete channel with a width of 50cm and a channel depth of 60cm, a slope of 2.5%, check whether the design is OK, and issue a complete inspection report.
- Channel number, B(cm), H(cm), slope(%), flow(CMS), channel pavement type
1-1,40,60,1.5,0.25,Reinforced concrete rectangular channel
1-2,40,70,1.5,0.30,Reinforced concrete rectangular channel
Check the above channel design and output the results in markdown table format.
- There is a slope of fractured rock mass with an angle of about 60 degrees, located in a tropical rainy area, please provide slope protection suggestions.
- A non-foundation concrete gravity retaining wall, total height 2.3M, wall top width 50cm, wall bottom width 100cm, soil unit weight 18kN/m3, friction angle 30 degrees, cohesion 10kPa, groundwater level below 2M from the wall top, seismic coefficient 0.15, soil foundation, please call the MCP tool to check its stability under normal and seismic conditions, and output a complete calculation report.
- Concrete channel, height=1.5, wall_slope=0.5, soil_slope=15, soil_angle=30, effective_depth=0.2, call the tool to calculate the required reinforcement and recommended reinforcement for the channel?
- How to estimate the "average annual soil loss" in Taichung? What parameters need to be provided?
- Please calculate the flow velocity and flow depth of a concrete circular pipe with a diameter of 60 cm, a flow rate of 0.5cms, a slope of 1.2%, and a Manning's coefficient of 0.013
- Calculate the flow velocity and flow depth of a reinforced concrete rectangular channel with a width of 30 cm and a height of 50cm, a flow rate of 0.5cms, and a slope of 1.2%?
- Calculate the flow velocity and flow depth of a reinforced concrete rectangular channel with a width of 50 cm and a height of 70cm, a flow rate of 1cms, and a slope of 5%? Output a complete report, including the calculation process and calculation formula.
- Calculate the flow velocity and flow depth of a "normal sandy soil trapezoidal channel" with a bottom width of 50 cm, a top width of 100cm, and a height of 70cm, a flow rate of 0.2cms, and a slope of 0.7%? Output a complete report, including the calculation process and calculation formula.
- A watershed area is about 5ha, flat cultivated land, New Taipei City, return period 50 years, rainfall duration 60min, call the tool to obtain the rainfall intensity value of the area, calculate the maximum runoff of the watershed?
- Based on this runoff, design a concrete channel with a width of 50cm and a channel depth of 60cm, a slope of 2.5%, check whether the design is OK, and issue a complete inspection report (including the maximum runoff of the watershed).
- The output result using Gemini 2.5 Pro is as follows: Call tools: query_idf_curve (rainfall intensity-duration-frequency (IDF) curve query), query_runoff_coeff (runoff coefficient C value query tool), calc_catchment_runoff (maximum catchment runoff calculation), get_manning_n (Manning's coefficient query for common materials), calc_channel_section_flow (drainage section velocity/depth/flow calculation)
# Concrete Channel Design Verification Report
## 1. Design Goal
This report aims to verify whether the designed concrete channel section can safely accommodate the maximum runoff generated by the upstream watershed under a specific return period.
## 2. Summary of Maximum Runoff Calculation for Watershed
* **Watershed Conditions:**
* Area (A): 5.0 hectares (ha)
* Land Use: Flat cultivated land
* Location: New Taipei City
* **Design Conditions:**
* Return Period (T): 50 years
* Rainfall Duration (D): 60 minutes
* **Calculation Parameters:**
* Rainfall Intensity (I): 140.0 mm/hr (based on the 50-year 60-minute IDF curve for New Taipei City)
* Runoff Coefficient (C): 0.53 (flat cultivated land, taking the average value of the specification)
* **Calculation Formula (Rational Formula):** Q = (C × I × A) / 360
* **Calculation Result (Design Flow Q_design):**
* Q_design = (0.53 × 140.0 × 5.0) / 360 ≈ **1.03 cms**
## 3. Concrete Channel Design Parameters
* Section Type: Rectangular
* Channel Material: Concrete
* Manning's Roughness Coefficient (n): 0.012
* Channel Width (b): 50 cm (0.5 m)
* Channel Depth (H): 60 cm (0.6 m)
* Channel Slope (S): 2.5 % (0.025 m/m)
## 4. Hydraulic Calculation and Verification
Using Manning's formula, hydraulic calculations are performed for the design flow (Q = 1.03 cms) and the above channel parameters:
* **Calculation Formulas:**
* Q = A × V
* V = (1/n) × R^(2/3) × S^(1/2)
* A = b × y
* P = b + 2y
* R = A / P
* **Calculation Results:**
* Actual Velocity (V): **4.014 m/s**
* Actual Water Depth (y): **0.513 m (51.3 cm)**
* **Verification Items:**
* **Capacity Check:**
* Calculated Water Depth (y) = 51.3 cm
* Design Channel Depth (H) = 60.0 cm
* **Freeboard = H - y = 60.0 - 51.3 = 8.7 cm**
* *Assessment:* The channel section can accommodate the design flow, with a freeboard of 8.7 cm. General engineering design recommends reserving about 10-20% of the channel depth or at least 10-15cm of freeboard as a safety margin. The freeboard here is slightly insufficient, and it is recommended to consider increasing the channel depth to increase the safety factor.
* **Velocity Check:**
* Calculated Velocity (V) = 4.014 m/s
* Allowable Velocity Range for Concrete (V_allowable): 4.57 ~ 6.1 m/s (based on common values in water and soil conservation technical specifications)
* *Assessment:* The calculated velocity of 4.014 m/s is lower than the lower limit of the allowable velocity for concrete (4.57 m/s), indicating that this velocity is safe for the concrete channel itself and will not cause channel erosion.
## 5. Conclusion and Recommendations
1. **Capacity:** The designed concrete channel section (width 50cm, depth 60cm) **can accommodate** a design flow of 1.03 cms.
2. **Velocity:** The calculated velocity of 4.014 m/s is within the safe allowable range for concrete.
3. **Freeboard:** The calculated freeboard is 8.7 cm, which is relatively low.
4. **Recommendation:** Although this section can pass the design flow in calculation, considering actual construction errors, siltation, or the possibility of future flow increases, **it is recommended to appropriately increase the channel depth (for example, increase to 70 cm or more)** to provide a more sufficient freeboard and increase the overall design safety and resilience.
---
## License
This project is licensed under the MIT License, and you are welcome to use and contribute freely.
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.