> ## Documentation Index
> Fetch the complete documentation index at: https://composio-27-feat-docs-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Tools Without Auth

> Create standalone custom tools and actions for any functionality you need (e.g., data processing, calculations, or integrations with other services)

<Tip>
  Custom Actions are powerful building blocks that enable you to create custom functionality while running independently. They can handle everything from simple data processing to complex third-party integrations.
</Tip>

## Creating a Custom Tool without Authentication

<Steps>
  <Step title="Install required libraries">
    <CodeGroup>
      ```bash Python
      pip install composio-openai openai
      ```

      ```bash JavaScript
      npm install composio-core openai
      ```
    </CodeGroup>
  </Step>

  <Step title="Import libraries">
    <CodeGroup>
      ```python Python
      from composio_openai import ComposioToolSet, action
      from openai import OpenAI

      openai_client = OpenAI()
      toolset = ComposioToolSet()
      ```

      ```javascript JavaScript
      import { OpenAIToolSet } from "composio-core"
      import { OpenAI } from "openai";
      import { z } from "zod"

      const openai_client = new OpenAI();
      const toolset = new OpenAIToolSet();
      ```
    </CodeGroup>
  </Step>

  <Step title="Creating a custom action">
    Below are examples of creating a custom action called `my_custom_action` (Python) & `myCustomAction` (JavaScript) to make cowsay say whatever you want it to say.

    You need to add the action, input parameters & return content description, this is what the LLM will use to understand the action.

    <CodeGroup>
      ```python Python
      @action(toolname="cow", requires=["cowsay"])
      def my_custom_action(message: str) -> str:
          """
          Cow will say whatever you want it to say.

          :param message: Message to be displayed
          :return greeting: Formatted message.
          """
          import cowsay
          
          return cowsay.get_output_string("cow", message)
      ```

      ```javascript JavaScript
      await toolset.createAction({
          actionName: "myCustomAction",
          description: "Cow will say whatever you want it to say",
          inputParams: z.object({
              message: z.string()
          }),
          callback: async (inputParams) => {
              const message = inputParams.message;
              const cowMessage = `Cow says: ${message}`;
              return cowMessage;
          }
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Executing the Custom Action">
    Executing the custom action using LLM. Learn how to execute the custom action without LLM [here](/patterns/tools/use-tools/action-guide-without-agents#how-to-execute-custom-actions-directly).

    <CodeGroup>
      ```python Python
      tools = toolset.get_tools(actions=[my_custom_action])

      task = "Say 'AI is the future' using cowsay"

      response = openai_client.chat.completions.create(
      model="gpt-4o-mini",
      tools=tools,
      messages=
          [
              {"role": "system", "content": "You are a helpful assistant."},
              {"role": "user", "content": task},
          ],
      )

      result = toolset.handle_tool_calls(response)
      print(result)
      ```

      ```javascript JavaScript
      const tools = await toolset.getTools({
          actions: ["myCustomAction"]
      });

      const instruction = "Say 'AI is the future' using cowsay";

      const response = await openai_client.chat.completions.create({
          model: "gpt-4o-mini",
          messages: [{ role: "user", content: instruction }],
          tools: tools,
          tool_choice: "auto",
      });

      const result = await toolset.handleToolCall(response);
      console.log(result);
      ```
    </CodeGroup>

    Output from executing Custom Action

    <CodeGroup>
      ```shell Python
        ________________
      | AI is the future |
        ================
                      \
                       \
                         ^__^
                         (oo)\_______
                         (__)\       )\/\
                             ||----w |
                             ||     ||
      ```

      ```shell JavaScript
      Cow says: AI is the future
      ```
    </CodeGroup>
  </Step>
</Steps>

### Why Use Custom Tools or Actions?

Custom Tools or Actions provide several advantages:

* **Data privacy:** Execution happens on the user’s machine, ensuring sensitive data doesn’t leave the local environment
* **Flexibility:** Users can create and customize as many tools and actions as needed
* **Compatibility:** Custom actions can be integrated seamlessly across various Composio-supported platforms
