Enable AI models to interact with external functions and data sources using tools.
Tools allow you to give AI models access to external functions or data sources, enabling them to perform actions beyond simple text generation. You can define custom tools or use Latitude’s built-in tools.
Tool support depends on the specific AI provider and model. Check your
provider’s documentation for compatibility.
To make tools available to your prompt, list them under the tools key in the prompt’s configuration block (---).
---provider: openaimodel: gpt-4otools: - latitude/search # Use a built-in Latitude tool - get_weather: description: Get the current weather for a specified location. parameters: # JSON Schema for parameters type: object properties: location: type: string description: The city and state, e.g., San Francisco, CA required: [location]---<user>What's the weather like in {{ location }}?</user>
For capabilities beyond the built-in tools, you can define your own custom tools. When the model decides to use a custom tool, Latitude will request its execution from your application via the SDK.Define custom tools directly within the configuration block, outside the main tools list:
---provider: openaimodel: gpt-4otools: - get_stock_price: description: Retrieves the current stock price for a given ticker symbol. parameters: type: object properties: ticker_symbol: type: string description: The stock ticker symbol (e.g., AAPL, GOOGL). required: [ticker_symbol]---<user>What is the current price of {{ ticker }} stock?</user>
Each custom tool definition requires:
description: A clear explanation for the AI model of what the tool does.
parameters: A JSON Schema defining the expected input arguments for the tool.
Tool parameters must be defined using JSON Schema to specify their structure, types, and requirements. This helps the model understand how to call the tool correctly.Key schema components:
add_calendar_event: description: Adds an event to the user's calendar. parameters: type: object properties: title: type: string description: The title of the event. date: type: string description: The date of the event (YYYY-MM-DD). time: type: string description: The time of the event (HH:MM). duration_minutes: type: integer description: Duration of the event in minutes. required: [title, date, time]
If you want to define a tool without parameters, for example a tool that generates a random number, you can omit the parameters key. However, providers such as Anthropic or Google, always requires parameters. In this case, the best option is to define an empty object as parameters:
---provider: anthropicmodel: claude-sonnet-4-0type: agenttools: - randomizer: description: Generates a random number. parameters: type: object properties: {} required: []---
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Latitude Docs","colors":{"primary":"#0080ff","light":"#0080ff","dark":"#0080ff"},"logo":{"light":"https://mintcdn.com/latitudellms/Ssq9dzRdSVyjHEcj/logo/light.svg?fit=max\u0026auto=format\u0026n=Ssq9dzRdSVyjHEcj\u0026q=85\u0026s=0f5a2f28c08aa15169274fb611bb7cb4","dark":"https://mintcdn.com/latitudellms/Ssq9dzRdSVyjHEcj/logo/dark.svg?fit=max\u0026auto=format\u0026n=Ssq9dzRdSVyjHEcj\u0026q=85\u0026s=1865443ef1242937e62677890c184176"},"favicon":"https://mintcdn.com/latitudellms/Ssq9dzRdSVyjHEcj/favicon.svg?fit=max\u0026auto=format\u0026n=Ssq9dzRdSVyjHEcj\u0026q=85\u0026s=82111b5b93980b0770d626f2ae5d1c63","navbar":{"primary":{"type":"button","label":"Get started","href":"https://app.latitude.so/"}},"footer":{"socials":{"twitter":"https://twitter.com/trylatitude","github":"https://github.com/latitude-dev/latitude-llm","linkedin":"https://www.linkedin.com/company/trylatitude"}},"seo":{"metatags":{"robots":"noindex"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"latitudellms","hasAudioNarration":false,"actualSubdomain":"latitudellms","customDomains":["docs-v1.latitude.so"],"gitSource":{"type":"github","owner":"latitude-dev","repo":"latitude-llm","deployBranch":"latitude-v1","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a98bdaf1a3978f98e37244e","collectionId":"67766419-42b4-45ee-b0c0-17e625e4564c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a98bdaf1a3978f98e37244e"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6a98bdaf1a3978f98e37244e","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"Examples","count":36},{"language":"default","tag":"Latitude","count":35},{"language":"default","tag":"Developers","count":26},{"language":"default","tag":"Providers","count":18},{"language":"default","tag":"PromptL","count":14},{"language":"default","tag":"Overview","count":10},{"language":"default","tag":"SDK examples","count":10},{"language":"default","tag":"Prompting Techniques","count":10},{"language":"default","tag":"Use cases","count":8},{"language":"default","tag":"Deployment","count":8}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"guides/prompt-manager/tools","slug":"/guides/prompt-manager/tools","pageMetadata":{"title":"Tool use","description":"Enable AI models to interact with external functions and data sources using tools.","href":"/guides/prompt-manager/tools"},"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: \"Enable AI models to interact with external functions and data sources using tools.\"\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`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Tools allow you to give AI models access to external functions or data sources, enabling them to perform actions beyond simple text generation. You can define custom tools or use Latitude’s built-in tools.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Tool support depends on the specific AI provider and model. Check your\nprovider’s documentation for compatibility.`})}),`\n`,_jsx(Heading,{level:`2`,id:`enabling-tools-in-a-prompt`,children:`Enabling Tools in a Prompt`}),`\n`,_jsxs(_components.p,{children:[`To make tools available to your prompt, list them under the `,_jsx(_components.code,{children:`tools`}),` key in the prompt’s configuration block (`,_jsx(_components.code,{children:`---`}),`).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`18`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`openai`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gpt-4o`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`tools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`latitude/search`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Use a built-in Latitude tool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`get_weather`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Get the current weather for a specified location.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` parameters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# JSON Schema for parameters`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`object`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` properties`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` location`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`The city and state, e.g., San Francisco, CA`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` required`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`location`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cuser>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`What's the weather like in {{ location }}?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/user>`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`built-in-latitude-tools`,children:`Built-in Latitude Tools`}),`\n`,_jsx(_components.p,{children:`Latitude provides several powerful built-in tools that you can enable directly:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`latitude/search`}),`: Performs web searches to find up-to-date information.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`latitude/code`}),`: Executes code snippets.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`latitude/extract`}),`: Extracts structured data from text.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Simply include their names (e.g., `,_jsx(_components.code,{children:`latitude/search`}),`) in the `,_jsx(_components.code,{children:`tools`}),` list.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/guides/prompt-manager/latitude-tools`,children:`Learn more about using Latitude Tools`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`defining-custom-tools`,children:`Defining Custom Tools`}),`\n`,_jsx(_components.p,{children:`For capabilities beyond the built-in tools, you can define your own custom tools. When the model decides to use a custom tool, Latitude will request its execution from your application via the SDK.`}),`\n`,_jsxs(_components.p,{children:[`Define custom tools directly within the configuration block, outside the main `,_jsx(_components.code,{children:`tools`}),` list:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`openai`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`gpt-4o`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`tools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`get_stock_price`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Retrieves the current stock price for a given ticker symbol.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` parameters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`object`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` properties`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` ticker_symbol`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`The stock ticker symbol (e.g., AAPL, GOOGL).`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` required`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ticker_symbol`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cuser>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`What is the current price of {{ ticker }} stock?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/user>`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Each custom tool definition requires:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`description`})}),`: A clear explanation for the AI model of what the tool does.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`parameters`})}),`: A `,_jsx(_components.a,{href:`#json-schema-for-parameters`,children:`JSON Schema`}),` defining the expected input arguments for the tool.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`handling-custom-tool-calls`,children:`Handling Custom Tool Calls`}),`\n`,_jsxs(_components.p,{children:[`When the AI model decides to use `,_jsx(_components.code,{children:`get_stock_price`}),`, the Latitude SDK in your application will receive a tool call request. Your code needs to:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Execute the actual logic (e.g., call a financial API).`}),`\n`,_jsx(_components.li,{children:`Return the result back to Latitude.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Refer to the SDK documentation (`,_jsx(_components.a,{href:`/guides/sdk/typescript`,children:`TypeScript`}),`, `,_jsx(_components.a,{href:`/guides/sdk/python`,children:`Python`}),`) for details on handling tool calls.`]}),`\n`,_jsx(Heading,{level:`2`,id:`json-schema-for-parameters`,children:`JSON Schema for Parameters`}),`\n`,_jsxs(_components.p,{children:[`Tool parameters `,_jsx(_components.strong,{children:`must`}),` be defined using JSON Schema to specify their structure, types, and requirements. This helps the model understand how to call the tool correctly.`]}),`\n`,_jsx(_components.p,{children:`Key schema components:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`type`}),`: `,_jsx(_components.code,{children:`object`}),`, `,_jsx(_components.code,{children:`string`}),`, `,_jsx(_components.code,{children:`number`}),`, `,_jsx(_components.code,{children:`integer`}),`, `,_jsx(_components.code,{children:`boolean`}),`, `,_jsx(_components.code,{children:`array`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`description`}),`: Essential for explaining parameters to the model.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`properties`}),` (for `,_jsx(_components.code,{children:`object`}),` type): Defines nested parameters.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`required`}),` (for `,_jsx(_components.code,{children:`object`}),` type): Lists mandatory properties.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`enum`}),` (for `,_jsx(_components.code,{children:`string`}),`, `,_jsx(_components.code,{children:`number`}),`): Specifies allowed values.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`items`}),` (for `,_jsx(_components.code,{children:`array`}),` type): Defines the schema for array elements.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`https://json-schema.org/learn/getting-started-step-by-step`,children:`official JSON Schema guide`}),` for more details.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example (Object with multiple parameters):`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`add_calendar_event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Adds an event to the user's calendar.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` parameters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`object`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` properties`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` title`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`The title of the event.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`The date of the event (YYYY-MM-DD).`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` time`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`The time of the event (HH:MM).`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` duration_minutes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`integer`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Duration of the event in minutes.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` required`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`title`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`time`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`tools-without-parameters`,children:`Tools without Parameters`}),`\n`,_jsx(_components.p,{children:`If you want to define a tool without parameters, for example a tool that generates a random number, you can omit the parameters key. However, providers such as Anthropic or Google, always requires parameters. In this case, the best option is to define an empty object as parameters:`}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[8,9,10,11]`,numberOfLines:`12`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`anthropic`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`claude-sonnet-4-0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`agent`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`tools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`randomizer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Generates a random number.`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` parameters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`object`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` properties`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {}`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` required`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: []`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Explore `,_jsx(_components.a,{href:`/guides/prompt-manager/latitude-tools`,children:`Latitude’s Built-in Tools`}),` in more detail.`]}),`\n`,_jsxs(_components.li,{children:[`Learn how to build powerful `,_jsx(_components.a,{href:`/guides/prompt-manager/agents`,children:`Agents`}),` that leverage tools.`]}),`\n`,_jsxs(_components.li,{children:[`Test tool interactions in the `,_jsx(_components.a,{href:`/guides/prompt-manager/playground#testing-tool-responses`,children:`Playground`}),`.`]}),`\n`]})]})}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":"Tool use","description":"Enable AI models to interact with external functions and data sources using tools.","href":"/guides/prompt-manager/tools"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Enabling Tools in a Prompt","slug":"enabling-tools-in-a-prompt","depth":2,"children":[]},{"title":"Built-in Latitude Tools","slug":"built-in-latitude-tools","depth":2,"children":[]},{"title":"Defining Custom Tools","slug":"defining-custom-tools","depth":2,"children":[{"title":"Handling Custom Tool Calls","slug":"handling-custom-tool-calls","depth":3,"children":[]}]},{"title":"JSON Schema for Parameters","slug":"json-schema-for-parameters","depth":2,"children":[{"title":"Tools without Parameters","slug":"tools-without-parameters","depth":3,"children":[]}]},{"title":"Next Steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/latitudellms/98203f04b0eae836/script.js"],"subdomain":"latitudellms","siteName":"Latitude Docs","title":"Tool use - Latitude Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-26T17:21:36.316Z","originalFileLocation":"guides/prompt-manager/tools.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;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=\"system\"}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=\"Enable AI models to interact with external functions and data sources using tools.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Latitude Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"noindex\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_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/latitudellms/nd8UhULMfcLSBoZ-/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Tool use - Latitude Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Enable AI models to interact with external functions and data sources using tools.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Latitude Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs-v1.latitude.so/guides/prompt-manager/tools\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://latitudellms.mintlify.app/_mintlify/api/og/v2?division=Prompts\u0026amp;title=Tool+use\u0026amp;description=Enable+AI+models+to+interact+with+external+functions+and+data+sources+using+tools.\u0026amp;theme=ab9bfabc69091edb5dcaeb95\u0026amp;signature=b67895a8aafb3f227fb0e561a18b8d647a0a35e98a85ac90f3f279538d28e41a\">\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=\"Tool use - Latitude Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Enable AI models to interact with external functions and data sources using tools.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://latitudellms.mintlify.app/_mintlify/api/og/v2?division=Prompts\u0026amp;title=Tool+use\u0026amp;description=Enable+AI+models+to+interact+with+external+functions+and+data+sources+using+tools.\u0026amp;theme=ab9bfabc69091edb5dcaeb95\u0026amp;signature=b67895a8aafb3f227fb0e561a18b8d647a0a35e98a85ac90f3f279538d28e41a\">\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/latitudellms/nd8UhULMfcLSBoZ-/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Latitude Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0080ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs-v1.latitude.so/guides/prompt-manager/tools\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/prompt-manager/tools.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs-v1.latitude.so/#organization\",\"name\":\"Latitude Docs\",\"url\":\"https://docs-v1.latitude.so\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/latitudellms/Ssq9dzRdSVyjHEcj/logo/light.svg?fit=max\u0026auto=format\u0026n=Ssq9dzRdSVyjHEcj\u0026q=85\u0026s=0f5a2f28c08aa15169274fb611bb7cb4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs-v1.latitude.so#website\",\"name\":\"Latitude Docs\",\"url\":\"https://docs-v1.latitude.so\",\"publisher\":{\"@id\":\"https://docs-v1.latitude.so/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools#webpage\",\"url\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools\",\"name\":\"Tool use\",\"description\":\"Enable AI models to interact with external functions and data sources using tools.\",\"dateModified\":\"2026-01-26T17:21:36.316Z\",\"isPartOf\":{\"@id\":\"https://docs-v1.latitude.so#website\"},\"breadcrumb\":{\"@id\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Prompts\",\"item\":\"https://docs-v1.latitude.so/guides/prompt-manager/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tool use\",\"item\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools#article\",\"headline\":\"Tool use\",\"name\":\"Tool use\",\"description\":\"Enable AI models to interact with external functions and data sources using tools.\",\"url\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools\",\"mainEntityOfPage\":{\"@id\":\"https://docs-v1.latitude.so/guides/prompt-manager/tools#webpage\"},\"dateModified\":\"2026-01-26T17:21:36.316Z\",\"publisher\":{\"@id\":\"https://docs-v1.latitude.so/#organization\"},\"isPartOf\":{\"@id\":\"https://docs-v1.latitude.so#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Latitude Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Latitude Docs","nav":{"global":null,"tabs":[{"tab":"Latitude","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/guides/getting-started/introduction"}]},{"group":"Getting started","pages":[{"group":"Developers","pages":[{"title":"Developers","href":"/guides/getting-started/quick-start-dev"}]},{"group":"No-code","pages":[{"title":"No Code","href":"/guides/getting-started/quick-start-pm"}]}]},{"group":"Prompts","pages":[{"title":"Editor","href":"/guides/prompt-manager/overview"},{"title":"Configuration","href":"/guides/prompt-manager/configuration"},{"title":"Playground","href":"/guides/prompt-manager/playground"},{"title":"Version Control","href":"/guides/prompt-manager/version-control"},{"title":"Structured Output","description":"Define JSON schemas to ensure structured and validated responses from AI models.","href":"/guides/prompt-manager/json-output"},{"title":"Tool use","href":"/guides/prompt-manager/tools"},{"title":"Triggers","description":"Enables automatic execution of prompts based on specific events or schedules","href":"/guides/prompt-manager/triggers"},{"title":"Best Practices","href":"/guides/prompt-manager/prompt-best-practices"}]},{"group":"Agents","pages":[{"title":"Agents","href":"/guides/prompt-manager/agents"},{"title":"Subagents","href":"/guides/prompt-manager/subagents"}]},{"group":"Evaluations","pages":[{"title":"Overview","href":"/guides/evaluations/overview"},{"group":"Types","pages":[{"title":"LLM-as-Judges","href":"/guides/evaluations/llm-as-judges"},{"title":"Programmatic Rules","href":"/guides/evaluations/programmatic-rules"},{"title":"Humans-in-the-Loop","href":"/guides/evaluations/humans-in-the-loop"},{"title":"Composite Scores","href":"/guides/evaluations/composite-scores"}]},{"title":"Running Evaluations","href":"/guides/evaluations/running-evaluations"},{"title":"Prompt Suggestions","href":"/guides/evaluations/prompt-suggestions"},{"title":"Evaluation Workflows","href":"/guides/evaluations/integrating-evaluations-workflow"}]},{"group":"Datasets","pages":[{"title":"Overview","href":"/guides/datasets/overview"},{"title":"Golden Datasets","href":"/guides/datasets/golden-datasets"}]},{"group":"Experiments","pages":[{"title":"Overview","href":"/guides/experiments/overview"}]},{"group":"Deployment","pages":[{"group":"Latitude SDK","pages":[{"title":"TypeScript","href":"/guides/sdk/typescript"},{"title":"Python","href":"/guides/sdk/python"}]},{"group":"HTTP API","pages":[{"title":"API Access","href":"/guides/api/api-access"},{"title":"Streaming Events","href":"/guides/api/streaming-events"},{"title":"Webhooks","href":"/guides/api/webhooks"}]},{"group":"CLI","pages":[{"title":"CLI Overview","href":"/guides/cli/overview"},{"title":"Installation \u0026 Auth","href":"/guides/cli/installation"},{"title":"Command Reference","href":"/guides/cli/commands"}]}]},{"group":"Self-Hosting","pages":[{"title":"Development Setup","href":"/guides/self-hosted/development-setup"},{"title":"Production Deployment","href":"/guides/self-hosted/production-setup"}]},{"group":"Support","pages":[{"title":"Community and Support","href":"/guides/integration/community-support"}]}]},{"tab":"PromptL","pages":[{"title":"PromptL","href":"/promptl/getting-started/introduction"}]},{"tab":"Developers","pages":[{"title":"Developers","href":"/developers/overview"}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/overview"}]}]},"title":"Tool use - Latitude Docs","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":[],"chunks":[]}