> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bindai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 07.3 shared tools

# Shared Tools

Shared Tools allow multiple applications, agents, and workflows within a BindAI project to reuse the same functionality.

Instead of implementing identical tools in every application, a tool can be registered once at the project level and made available wherever it is needed.

This promotes consistency, maintainability, and code reuse.

***

# What are Shared Tools?

A shared tool is a reusable function registered with the project.

Conceptually:

```text id="st1" theme={null}
Project

↓

Tool Registry

↓

Applications

↓

Agents
```

Every registered tool can be used by multiple agents across the project.

***

# Why Share Tools?

Without shared tools, projects often duplicate functionality.

For example:

```text id="st2" theme={null}
Support Agent

↓

Database Lookup

Sales Agent

↓

Database Lookup

HR Agent

↓

Database Lookup
```

Instead of maintaining three implementations, BindAI encourages one shared tool.

***

# Project Tool Registry

Projects maintain a centralized tool registry.

```text id="st3" theme={null}
Project

↓

Tool Registry

├── Search

├── Database

├── Email

├── Calendar

└── Weather
```

Applications access tools through this registry.

***

# Registering a Tool

A tool is registered once.

Conceptually:

```python id="st4" theme={null}
project.add_tool(
    search_tool,
)
```

After registration, the tool becomes available throughout the project.

***

# Using Shared Tools

Agents can invoke shared tools during execution.

```text id="st5" theme={null}
Agent

↓

Shared Tool

↓

Result

↓

Agent Response
```

The agent does not need to know where the tool was originally defined.

***

# Tool Reuse

Multiple applications can share the same tool.

```text id="st6" theme={null}
Project

↓

Search Tool

↙      ↓      ↘

Support

Sales

HR
```

A single implementation serves every application.

***

# Typical Shared Tools

Common examples include:

* database queries
* web search
* email sending
* calendar integration
* file access
* document retrieval
* internal APIs
* weather services
* CRM integration

These tools are useful across many business domains.

***

# Shared Tools vs Local Tools

Some tools belong only to a specific application.

| Shared Tool                   | Local Tool                 |
| ----------------------------- | -------------------------- |
| Used by multiple applications | Used by one application    |
| Registered at project level   | Registered locally         |
| Highly reusable               | Domain-specific            |
| Centralized maintenance       | Independent implementation |

Choose the appropriate scope based on reuse.

***

# Versioning

Because many agents may depend on the same tool, updates should be made carefully.

Good practices include:

* maintaining backward compatibility
* testing before deployment
* documenting interface changes
* avoiding unnecessary breaking changes

A stable tool interface benefits the entire project.

***

# Tool Organization

As projects grow, organize shared tools into categories.

Example:

```text id="st7" theme={null}
tools/

├── database/

├── communication/

├── retrieval/

├── utilities/

└── integrations/
```

Logical organization improves discoverability and maintenance.

***

# Security

Shared tools often access sensitive systems.

Examples include:

* databases
* cloud services
* internal APIs
* financial systems

Protect these tools by:

* validating inputs
* limiting permissions
* handling errors safely
* avoiding exposure of secrets
* logging important operations

***

# Performance

Frequently used shared tools should be designed for efficiency.

Consider:

* caching
* connection pooling
* batching requests
* minimizing network calls
* reducing duplicate work

Optimized shared tools improve performance for every application.

***

# Best Practices

* Register reusable tools at the project level.
* Keep tool interfaces stable.
* Make tools focused on a single responsibility.
* Validate inputs before execution.
* Handle failures gracefully.
* Document expected inputs and outputs.
* Organize tools into logical modules.

***

# Summary

Shared Tools provide a centralized way to reuse functionality across a BindAI project.

By registering tools once and making them available to multiple applications and agents, projects become easier to maintain, more consistent, and significantly less repetitive.
