---
title: "tool(named:)"
framework: swift-package-manager
role: symbol
role_heading: Instance Method
path: "swift-package-manager/documentation/packageplugin/plugincontext/tool(named:)"
---

# tool(named:)

Looks up and returns the path of a named command line executable.

## Declaration

```swift
func tool(named name: String) throws -> PluginContext.Tool
```

## Parameters

- `name`: The name of the executable to find.

## Discussion

Discussion The executable must be provided by an executable target or binary target on which the package plugin target depends. This function throws an error if the tool cannot be found. The lookup is case sensitive.

## See Also

### Inspecting the Context

- [pluginWorkDirectoryURL](swift-package-manager/documentation/packageplugin/plugincontext/pluginworkdirectoryurl.md)
- [package](swift-package-manager/documentation/packageplugin/plugincontext/package.md)
- [PluginContext.Tool](swift-package-manager/documentation/packageplugin/plugincontext/tool.md)
- [pluginWorkDirectory](swift-package-manager/documentation/packageplugin/plugincontext/pluginworkdirectory.md)
