Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.
Like sub-agents, programmatic tool calling (PTC) is a concept to understand, not something to configure: Dataleap applies it automatically when a workflow is repetitive, data-heavy, and deterministic. This page explains what it does — and the one question worth asking.
The one thing you can do: ask your agent, right in its chat — “Would PTC make sense here?” or “Do you use PTC?” It checks its own workflow, tells you honestly whether code would help, and restructures itself if it does. Worth asking whenever an agent feels slow or expensive on a repetitive job.
Without PTC, the model sits in the loop for every single tool call. With PTC, it writes one script that batches the calls — and only the clean summary ever touches the context:
Same workflow, two ways: 570 seconds and 200 credits — or 60 seconds and 40 credits.
On deterministic workflows, PTC is tremendously cheaper — typically 30–80% fewer credits, and much faster. Combined with the model tier strategy, repetitive workflows cost a fraction of their naive version.
Repetitive, deterministic work — the same call over hundreds of rows
One-off calls, or a couple of steps that need reasoning
Data-heavy loops where only the summary matters
Judgment-heavy flows — deciding based on what it finds
Multi-step pipelines: fetch → transform → write
Highly variable flows where the path changes every run
That’s also why Dataleap doesn’t use PTC everywhere: code is rigid. It’s fast and cheap on a fixed path, but a workflow that needs flexibility is better off reasoning step by step — and Dataleap makes that call for you.
Watch: Programmatic Tool Calling
See programmatic tool calling in action.
Chapter 4: Sharing is Caring
Next chapter: bring your team along.
Credits & usage
All the cost levers in one place.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Dataleap Docs","colors":{"primary":"#6176F3","light":"#A5B4FC","dark":"#444FE7"},"logo":{"light":"https://mintcdn.com/dataleap-469bb19d/IGRpvAo4Dtiy-ytC/logo.svg?fit=max\u0026auto=format\u0026n=IGRpvAo4Dtiy-ytC\u0026q=85\u0026s=fef1d0fbde1f931c92f3068c65ca6edd","dark":"https://mintcdn.com/dataleap-469bb19d/IGRpvAo4Dtiy-ytC/logo.svg?fit=max\u0026auto=format\u0026n=IGRpvAo4Dtiy-ytC\u0026q=85\u0026s=fef1d0fbde1f931c92f3068c65ca6edd"},"favicon":"https://mintcdn.com/dataleap-469bb19d/IGRpvAo4Dtiy-ytC/favicon.svg?fit=max\u0026auto=format\u0026n=IGRpvAo4Dtiy-ytC\u0026q=85\u0026s=e2a64436335ccd32fe41f660cf4a9dcc","appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"https://dataleap.ai","label":"Website"}],"primary":{"type":"button","label":"Open app","href":"https://app.dataleap.ai"}},"footer":{},"fonts":{"heading":{"family":"Inter Tight"},"body":{"family":"Inter"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://dataleap.ai"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dataleap-469bb19d","hasAudioNarration":false,"actualSubdomain":"dataleap-469bb19d","customDomains":["docs.dataleap.ai"],"gitSource":{"type":"github","owner":"dataleap-labs","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad72d24904810631a032ea5","collectionId":"fa5ba8c9-690f-4735-9ef2-17c184d3fdbc","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad72d24904810631a032ea5"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ad72d24904810631a032ea5","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Build your own agent","count":8},{"language":"default","tag":"Scale your craft","count":7},{"language":"default","tag":"Admin","count":6},{"language":"default","tag":"Sharing is Caring","count":6},{"language":"default","tag":"Video Series","count":5},{"language":"default","tag":"Introduction","count":4},{"language":"default","tag":"FAQ","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":true},"customCss":[{"filePath":"styles.css","content":":root{--dl-stone-25:oklch(0.994 0.001 106.4);--dl-stone-50:oklch(98.5% 0.001 106.423);--dl-stone-100:oklch(97% 0.001 106.424);--dl-stone-150:oklch(0.962 0.002 67.8);--dl-stone-200:oklch(92.3% 0.003 48.717);--dl-stone-300:oklch(86.9% 0.005 56.366);--dl-stone-550:oklch(0.5 0.011 62.4);--dl-stone-800:oklch(26.8% 0.007 34.298);--dl-primary-50:oklch(0.962 0.018 272.3);--dl-primary-100:oklch(0.93 0.033 272.8);--dl-primary-400:oklch(0.68 0.147 274.1);--dl-primary-700:oklch(0.458 0.215 272);--dl-radius-card:1.25rem;--dl-radius-control:0.75rem;--dl-border:var(--dl-stone-150);--dl-shadow-soft:0 1px 2px 0 rgba(41, 37, 36, 0.04),\n 0 12px 24px -10px rgba(41, 37, 36, 0.10);--dl-grid-line:oklch(0.9436 0.0017 67.8);--dl-font-display:'Inter Tight', 'Inter', ui-sans-serif, system-ui,\n -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;--dl-font-body:'Inter', ui-sans-serif, system-ui,\n -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;--background-light:250 250 249;--background-dark:22 22 24}body{font-family:var(--dl-font-body);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.prose h1,.prose h2,.prose h3,.prose h4,h1,h2,h3,h4,h5,h6{font-family:var(--dl-font-display);letter-spacing:-.02em;font-weight:500}code,kbd,pre,samp{font-family:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}::selection{background:var(--dl-primary-100);color:var(--dl-primary-700)}.card{border-radius:var(--dl-radius-card);border:1px solid var(--dl-border);box-shadow:var(--dl-shadow-soft);transition:transform 180ms cubic-bezier(.23,1,.32,1),box-shadow 180ms cubic-bezier(.23,1,.32,1),border-color 180ms cubic-bezier(.23,1,.32,1)}.card:hover{transform:translateY(-2px);border-color:var(--dl-primary-400);box-shadow:0 16px 32px -12px rgba(41,37,36,.14)}:is(html.dark) .card{border-color:oklch(.324 .008 59.4)}.card :is(button, input, select),.rounded-lg,button.rounded-lg{border-radius:var(--dl-radius-control)}main .prose>.card-group:first-of-type{position:relative;padding:1rem;border-radius:var(--dl-radius-card);background-image:repeating-linear-gradient(0deg,transparent,transparent 7px,var(--dl-grid-line) 7px,var(--dl-grid-line) 8px),repeating-linear-gradient(90deg,transparent,transparent 7px,var(--dl-grid-line) 7px,var(--dl-grid-line) 8px);background-clip:padding-box}:is(html.dark) main .prose>.card-group:first-of-type{background-image:repeating-linear-gradient(0deg,transparent,transparent 7px,oklch(.26 .005 60) 7px,oklch(.26 .005 60) 8px),repeating-linear-gradient(90deg,transparent,transparent 7px,oklch(.26 .005 60) 7px,oklch(.26 .005 60) 8px)}@media (max-width:640px){main .prose>.card-group:first-of-type{background-image:none;padding:0}}main video{border-radius:var(--dl-radius-card);border:1px solid var(--dl-border)}.prose{color:var(--dl-stone-800);line-height:1.7}:is(html.dark) .prose{color:oklch(92.3% .003 48.717)}.prose blockquote:not(.not-prose,.not-prose *),.prose ol:not(.not-prose,.not-prose *),.prose p:not(.not-prose,.not-prose *),.prose ul:not(.not-prose,.not-prose *){margin-top:1.1rem;margin-bottom:1.1rem}.prose h2:not(.not-prose,.not-prose *){margin-top:3rem;margin-bottom:.9rem}.prose h3:not(.not-prose,.not-prose *){margin-top:2.25rem;margin-bottom:.6rem}.prose li:not(.not-prose,.not-prose *){margin-top:.4rem;margin-bottom:.4rem}.prose li::marker{color:oklch(70.9% .01 56.259)}.card-group{margin-top:1.5rem;margin-bottom:1.5rem}"}],"page":{"pagePath":"scale/programmatic-tool-calling","slug":"/scale/programmatic-tool-calling","pageMetadata":{"title":"Programmatic tool calling","description":"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.","href":"/scale/programmatic-tool-calling"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,em:`em`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Card,CardGroup,Frame,Heading,OptimizedImage,Table,Tip}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Like `,_jsx(_components.a,{href:`/scale/sub-agents-and-intelligence-levels`,children:`sub-agents`}),`, programmatic tool calling (PTC) is a concept to understand, not something to configure: `,_jsx(_components.strong,{children:`Dataleap applies it automatically`}),` when a workflow is repetitive, data-heavy, and deterministic. This page explains what it does — and the one question worth asking.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`The one thing you can do:`}),` ask your agent, right in its chat — `,_jsx(_components.em,{children:`“Would PTC make sense here?”`}),` or `,_jsx(_components.em,{children:`“Do you use PTC?”`}),` It checks its own workflow, tells you honestly whether code would help, and restructures itself if it does. Worth asking whenever an agent feels slow or expensive on a repetitive job.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`what-it-does`,children:`What it does`}),`\n`,_jsx(_components.p,{children:`Without PTC, the model sits in the loop for every single tool call. With PTC, it writes one script that batches the calls — and only the clean summary ever touches the context:`}),`\n`,_jsx(Frame,{caption:`Same workflow, two ways: 570 seconds and 200 credits — or 60 seconds and 40 credits.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=218d86f569529396c65c22c99c51ad6a`,alt:`Comparison: one call at a time keeps the model in the loop for 17 round-trips costing 570 seconds and 200 credits, while one script with parallel calls finishes in 60 seconds for 40 credits`,\"data-og-width\":`2397`,width:`2397`,\"data-og-height\":`948`,height:`948`,\"data-path\":`images/ptc-comparison.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?w=280\u0026fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=11a3d40ffdf4074ae4be281be629807d 280w, https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?w=560\u0026fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=15e8085e54f83469d823894654d8b06a 560w, https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?w=840\u0026fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=e66636de3eeeef9165fca9db49cdd142 840w, https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?w=1100\u0026fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=569c994a1b1c204b518a96863409d658 1100w, https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?w=1650\u0026fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=51d7b61c6ec0704e364b6983333ef98c 1650w, https://mintcdn.com/dataleap-469bb19d/VSlx0hGHgzjtJCNw/images/ptc-comparison.png?w=2500\u0026fit=max\u0026auto=format\u0026n=VSlx0hGHgzjtJCNw\u0026q=85\u0026s=3fd8344bdd3ea0c304cd1aa6bde1ff6f 2500w`})}),`\n`,_jsxs(_components.p,{children:[`On deterministic workflows, PTC is tremendously cheaper — typically `,_jsx(_components.strong,{children:`30–80% fewer credits`}),`, and much faster. Combined with the `,_jsx(_components.a,{href:`/scale/sub-agents-and-intelligence-levels#model-tiers`,children:`model tier strategy`}),`, repetitive workflows cost a fraction of their naive version.`]}),`\n`,_jsx(Heading,{level:`2`,id:`where-it-helps-—-and-where-it-doesn’t`,children:`Where it helps — and where it doesn’t`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`✅ PTC pays off`}),_jsx(_components.th,{children:`❌ Plain tool use is better`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Repetitive, deterministic work — the same call over hundreds of rows`}),_jsx(_components.td,{children:`One-off calls, or a couple of steps that need reasoning`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data-heavy loops where only the summary matters`}),_jsx(_components.td,{children:`Judgment-heavy flows — deciding based on what it finds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Multi-step pipelines: fetch → transform → write`}),_jsx(_components.td,{children:`Highly variable flows where the path changes every run`})]})]})]}),`\n`,_jsx(_components.p,{children:`That’s also why Dataleap doesn’t use PTC everywhere: code is rigid. It’s fast and cheap on a fixed path, but a workflow that needs flexibility is better off reasoning step by step — and Dataleap makes that call for you.`}),`\n`,_jsx(Card,{title:`Watch: Programmatic Tool Calling`,icon:`clapperboard`,href:`/video-series/section-3#programmatic-tool-calling`,horizontal:true,children:_jsx(_components.p,{children:`See programmatic tool calling in action.`})}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Chapter 4: Sharing is Caring`,icon:`users`,href:`/share/overview`,children:_jsx(_components.p,{children:`Next chapter: bring your team along.`})}),_jsx(Card,{title:`Credits \u0026 usage`,icon:`chart-line`,href:`/admin/credits-and-usage`,children:_jsx(_components.p,{children:`All the cost levers in one place.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Programmatic tool calling","description":"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.","href":"/scale/programmatic-tool-calling"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What it does","slug":"what-it-does","depth":2,"children":[]},{"title":"Where it helps — and where it doesn’t","slug":"where-it-helps-—-and-where-it-doesn’t","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"dataleap-469bb19d","siteName":"Dataleap Docs","title":"Programmatic tool calling - Dataleap Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-17T13:50:56.719Z","originalFileLocation":"scale/programmatic-tool-calling.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Dataleap Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Programmatic tool calling - Dataleap Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Dataleap Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.dataleap.ai/scale/programmatic-tool-calling\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dataleap-469bb19d.mintlify.app/_mintlify/api/og/v2?division=Scale+your+craft\u0026amp;title=Programmatic+tool+calling\u0026amp;description=Your+agent+writes+a+script+that+runs+tool+calls+directly+from+code+%E2%80%94+instead+of+calling+tools+one+by+one.\u0026amp;theme=7c96bf66f584511b7192b1cd\u0026amp;signature=150213ac781a889928a5740b6f64cb038be98039a2c852975646eec204e29d4d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Programmatic tool calling - Dataleap Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dataleap-469bb19d.mintlify.app/_mintlify/api/og/v2?division=Scale+your+craft\u0026amp;title=Programmatic+tool+calling\u0026amp;description=Your+agent+writes+a+script+that+runs+tool+calls+directly+from+code+%E2%80%94+instead+of+calling+tools+one+by+one.\u0026amp;theme=7c96bf66f584511b7192b1cd\u0026amp;signature=150213ac781a889928a5740b6f64cb038be98039a2c852975646eec204e29d4d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dataleap-469bb19d/yCljMGNkrNkxhKk8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Dataleap Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6176F3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.dataleap.ai/scale/programmatic-tool-calling\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/scale/programmatic-tool-calling.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.dataleap.ai/#organization\",\"name\":\"Dataleap Docs\",\"url\":\"https://docs.dataleap.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dataleap-469bb19d/IGRpvAo4Dtiy-ytC/logo.svg?fit=max\u0026auto=format\u0026n=IGRpvAo4Dtiy-ytC\u0026q=85\u0026s=fef1d0fbde1f931c92f3068c65ca6edd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.dataleap.ai#website\",\"name\":\"Dataleap Docs\",\"url\":\"https://docs.dataleap.ai\",\"publisher\":{\"@id\":\"https://docs.dataleap.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling#webpage\",\"url\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling\",\"name\":\"Programmatic tool calling\",\"description\":\"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.\",\"dateModified\":\"2026-07-17T13:50:56.719Z\",\"isPartOf\":{\"@id\":\"https://docs.dataleap.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Scale your craft\",\"item\":\"https://docs.dataleap.ai/scale/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programmatic tool calling\",\"item\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling#article\",\"headline\":\"Programmatic tool calling\",\"name\":\"Programmatic tool calling\",\"description\":\"Your agent writes a script that runs tool calls directly from code — instead of calling tools one by one.\",\"url\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling\",\"mainEntityOfPage\":{\"@id\":\"https://docs.dataleap.ai/scale/programmatic-tool-calling#webpage\"},\"dateModified\":\"2026-07-17T13:50:56.719Z\",\"publisher\":{\"@id\":\"https://docs.dataleap.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.dataleap.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Dataleap Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Dataleap Docs","nav":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://dataleap.ai"}]},"groups":[{"group":"Introduction","pages":[{"title":"Dataleap docs","href":"/index"},{"title":"Chapter 1: Introduction","href":"/introduction/overview"},{"title":"What is Dataleap","href":"/introduction/what-is-dataleap"},{"title":"Getting started","href":"/introduction/getting-started"}]},{"group":"Build your own agent","pages":[{"title":"Chapter 2: Build your own agent","href":"/build/overview"},{"title":"Your first agent","href":"/build/your-first-agent"},{"title":"Shape agent behavior","href":"/build/shape-agent-behavior"},{"title":"Connect, use, and disconnect integrations","href":"/build/connect-your-tools"},{"title":"Add knowledge","href":"/build/add-knowledge"},{"title":"Database","href":"/build/agent-database"},{"title":"Triggers","href":"/build/triggers"},{"title":"Versioning","href":"/build/versioning"}]},{"group":"Scale your craft","pages":[{"title":"Chapter 3: Scale your craft","href":"/scale/overview"},{"title":"Build an app","href":"/scale/apps"},{"title":"Build a dashboard","href":"/scale/dashboards"},{"title":"Sub-agents \u0026 model tiers","href":"/scale/sub-agents-and-intelligence-levels"},{"title":"Agent-to-agent communication","href":"/scale/agent-to-agent-communication"},{"title":"Skills","description":"A skill is a reusable part of an agent: define a standard once — your ICP, your pricing methodology, a report format — and every agent that needs it follows it.","href":"/scale/skills"},{"title":"Programmatic tool calling","href":"/scale/programmatic-tool-calling"}]},{"group":"Sharing is Caring","pages":[{"title":"Chapter 4: Sharing is Caring","description":"From individual agents to scalable team usage: spaces, templates, and governance.","href":"/share/overview"},{"title":"Team spaces \u0026 team agents","href":"/share/team-spaces"},{"title":"Use only","href":"/share/use-only"},{"title":"Templates","href":"/share/templates"},{"title":"Locked templates","href":"/share/locked-templates"},{"title":"When to share what","href":"/share/when-to-share-what"}]},{"group":"Admin","pages":[{"title":"Chapter 5: Admin","href":"/admin/overview"},{"title":"Users, teams \u0026 organization","href":"/admin/users-and-roles"},{"title":"Credits \u0026 usage","href":"/admin/credits-and-usage"},{"title":"Models","href":"/admin/models"},{"title":"Integrations \u0026 permissions","href":"/admin/connected-apps-management"},{"title":"Slack apps","href":"/admin/slack-apps"}]},{"group":"Video Series","pages":[{"title":"Dataleap Video Series","href":"/video-series/overview"},{"title":"Section 1: Introduction","href":"/video-series/section-1"},{"title":"Section 2: Build your own agent","href":"/video-series/section-2"},{"title":"Section 3: Scale your craft","href":"/video-series/section-3"},{"title":"Section 4: Sharing is Caring","href":"/video-series/section-4"}]},{"group":"FAQ","pages":[{"title":"FAQ","href":"/faq"}]}]},"basePath":"","title":"Programmatic tool calling - Dataleap Docs","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-Bpq2Z6jK.js","DynamicMarkdown-D5M2At0B.js","zoom-image-lightbox-DL4wrF0w.js","lightbox-handle-r17bVUz3.js"]}