# TryGetAttributeWithName(string,MarkupAttribute)

Method in [MarkupParseResult](/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult.md)

## Summary

Gets the first attribute with the specified name, if present.

```csharp
public bool TryGetAttributeWithName(string name, out MarkupAttribute attribute)
```

## Parameters

| Name                                                                                                | Description                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` name                                                                                       | The name of the attribute to get.                                                                                                                                                                                                                   |
| [Yarn.Markup.MarkupAttribute](/2.0/api/csharp/yarn.markup/yarn.markup.markupattribute.md) attribute | When this method returns, contains the attribute with the specified name, if the attribute is found; otherwise, the default [MarkupAttribute](/2.0/api/csharp/yarn.markup/yarn.markup.markupattribute.md) . This parameter is passed uninitialized. |

## Returns

`true` if the [MarkupParseResult](/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult.md) contains an attribute with the specified name; otherwise, `false` .


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/2.0/api/csharp/yarn.markup/yarn.markup.markupparseresult/yarn.markup.markupparseresult.trygetattributewithname.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
