# Node.IPortDefinitionContext

> Interface that provides methods to define input and output ports during Node.OnDefinePorts execution.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.6/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public interface Node.IPortDefinitionContext
```

## Remarks

Use this interface within [Node.OnDefinePorts](/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/ondefineports.md) to declare the ports a node exposes. Ports define how the node connects to other nodes by specifying inputs and outputs.

## Methods

| Method                                                                                                                  | Description                                     |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| [AddInputPort](/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/iportdefinitioncontext/addinputport.md)   | Adds a new input port.                          |
| [AddOutputPort](/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/iportdefinitioncontext/addoutputport.md) | Adds a new output port with the specified name. |
