
Description
Python code execution via Azure AI Foundry Responses API with code_interpreter tool. Data analysis, charts, and math in a managed sandbox.
SKILL.md
Foundry Code — Code Interpreter (Responses API)
You have access to Python code execution via the Foundry Responses API code_interpreter tool. Use this for data analysis, chart generation, complex math, and file processing. No Foundry hosted agent needed — uses direct Responses API.
Why use this instead of local bash/python
The local sandbox has restricted packages. Foundry code_interpreter runs server-side with pre-installed data science libraries (pandas, numpy, matplotlib, scipy, etc.) and can generate visualizations.
Endpoint
All requests: http://localhost:8443 with ?api-version=2025-11-15-preview. Auth is automatic.
Operations
Run Python code
curl -s -X POST 'http://localhost:8443/openai/responses?api-version=2025-11-15-preview' \
-H 'Content-Type: application/json' \
-d '{"model":"gpt-4.1","input":"Calculate the first 20 Fibonacci numbers and show them.","tools":[{"type":"code_interpreter","container":{"type":"auto"}}],"store":false}'
The model will write and execute Python code, returning both the code and its output.
Data analysis
curl -s -X POST 'http://localhost:8443/openai/responses?api-version=2025-11-15-preview' \
-H 'Content-Type: application/json' \
-d '{"model":"gpt-4.1","input":"Generate 100 random data points, compute mean/median/std, and tell me if normally distributed.","tools":[{"type":"code_interpreter","container":{"type":"auto"}}],"store":false}'
When to use
- User asks for data analysis: "analyze this", "show statistics"
- Charts or visualizations: "plot the trend", "create a chart"
- Complex math: "solve this equation", "calculate correlation"
- Anything requiring Python runtime
When NOT to use
- For simple shell commands (use local bash)
- For web searches (use foundry-web-search)
- For document Q&A (use foundry-knowledge)
- For remembering preferences (use foundry-memory)
More skills from the kars repository
View all 11 skillsagt-governance
enforce behavioral governance for agents
Jul 12AgentsAuditAzureGovernance +1foundry-agents
inspect and invoke Foundry prompt agents
Jul 12AgentsAPI DevelopmentAzurefoundry-conversations
manage persistent conversations via Foundry
Jul 12AgentsAzureMemoryfoundry-deployments
query Foundry model deployments and infrastructure
Jul 12AzureInfrastructureLLMfoundry-evaluations
evaluate agent quality with Foundry Evals
Jul 12AzureEvalsLLMOpenAIfoundry-knowledge
retrieve knowledge via Foundry RAG
Jul 12AzureKnowledge ManagementResearchSearch
More from Azure (Microsoft)
View publisherazure-arg-external-evaluation-policy-author
author and test Azure Resource Graph policies
azure-policy
Jul 12AzureComplianceGovernancePolicyazure-blueprints-migration
migrate Azure Blueprints to Template Specs
azure-blueprints
Jul 12AzureDeploymentInfrastructure as CodeMigrationapiview-feedback-resolution
resolve APIView feedback on Azure SDKs
azure-sdk-tools
Jul 12API DevelopmentAzureCode ReviewDocumentationazsdk-common-live-and-recorded-tests
deploy resources and run Azure SDK tests
azure-sdk-tools
Jul 12AzureDeploymentSDKTestingazsdk-common-prepare-release-plan
manage Azure SDK release plan work items
azure-sdk-tools
Jul 12AzureGitHubProject ManagementSDKazsdk-common-sdk-release
release Azure SDK packages
azure-sdk-tools
Jul 12AzureCI/CDDeploymentSDK