Tools

Extend your agents with custom tools and integrations.

Tools give your agents the ability to interact with external systems, fetch data, and perform actions. LensOS provides a standardized framework for defining, registering, and managing tools.

Built-in Tools

LensOS includes several pre-built tools you can enable immediately:

  • Web Search — Search the web and return relevant results.
  • Calculator — Perform mathematical calculations.
  • Code Interpreter — Execute code snippets in a sandboxed environment.
  • File Reader — Read and parse uploaded documents.

Custom Tools

Define custom tools to connect your agent to any API or service:

tool-definition.ts
await lens.tools.create({
  name: 'get-weather',
  description: 'Get current weather for a location',
  parameters: {
    type: 'object',
    properties: {
      location: {
        type: 'string',
        description: 'City name or coordinates',
      },
    },
    required: ['location'],
  },
  handler: async ({ location }) => {
    const data = await fetchWeather(location)
    return { temperature: data.temp, condition: data.condition }
  },
})

Tool Configuration

Authentication

Tools can be configured with authentication credentials for accessing protected APIs:

  • API key authentication
  • OAuth 2.0 flows
  • Custom header-based auth

Permissions

Control which agents can access which tools. You can assign tools at the agent level or set organization-wide defaults.

Note

Tools are executed server-side in a secure environment. User data is never exposed to tool handlers unless explicitly passed.