Preheat your oven to 375°F (190°C). Cut the sugar pumpkin in half, remove seeds, and place cut-side down on a baking sheet. Bake for 45-60 minutes until tender.
Allow the pumpkin to cool, scoop out the flesh, and blend until smooth.
Prepare your glass by moistening the rim with lime juice and dipping it into a mix of sugar and pumpkin pie spice.
In a cocktail shaker, combine tequila, fresh lime juice, pumpkin puree, agave nectar, and pumpkin pie spice with ice. Shake well for about 15-20 seconds.
Strain into the prepared glass filled with ice and garnish as desired.