With the ongoing progress of urbanization, various issues such as resource scarcity, climate change, and carbon emissions overload have gradually emerged. Urban agriculture (UA) is recognized as a pivotal strategy to promote sustainable urban development. In this context, the study proposes a spatial scale hierarchy, encompassing “single building - building cluster - urban block," to formulate spatial strategies for the theoretical model of urban agricultural blocks. The theoretical model integrates production spaces, production methods, and spatial systems based on relevant design principles and the needs of residents. Nankai District's Qingfeng Road East Block in Tianjin is used as the site for applying and simulating the theoretical model. The results of the study show that UA in a 500m × 500m block can ideally eliminate the need for external food inputs by 100% for starchy vegetables, legumes and fruits, and meat/poultry, while achieving a 254.73% self-sufficiency rate for fungi. Additionally, it can reduce energy inputs by 28.33%, water inputs by 38.13%, and completely eliminate waste output for 8754 people. Carbon emission analysis indicates that the urban agricultural block can reduce approximately 2250.01t CO2 emissions from buildings and waste, with greater carbon-neutral potential in transportation and agriculture, forestry, and other land uses (AFOLU). This is significant for tackling various urban challenges and enhancing future development.