How can we filter GET helper with internal tags inside the post context

I want to filter related posts based on the internal tags in a post.

The following code is working fine for public tags

{{#get "posts" limit="5" filter="tags:[{{tags[*].slug}}]+id:-{{id}}" include="authors" as |related_posts|}}
	{{#if related_posts}}
		{{>sections_content}}
	{{/if}}
{{/get}}

Is there any way we can use the visibility="internal" attribute in tags helper to filter the internal tags out?

I have tried both of the following methods.

{{#get "posts" limit="5" filter="tags:[{{#if tags}}{{#foreach tags visibility="all"}}{{#has visibility="internal"}}{{slug}}{{/has}}{{/foreach}}{{/if}}]+id:-{{id}}" include="authors" as |related_posts|}}

{{/get}}

and,

{{#get "posts" limit="5" filter="tags:[{{tags[*].slug visibility="internal"}}]+id:-{{id}}" include="authors" as |related_posts|}}

{{/get}}

But as soon as I use the visibility="internal" attribute, it throws an error.
Any advice would be greatly appreciated.

Thank you.
Kasun.

Try this

{{#get "tags" limit="all"}}
    {{#foreach tags visibility="internal"}}
        {{name}}
    {{/foreach}}
{{/get}}