While playing around with the MCP Server, I really wish these things were possible:
New Parameters for New-PSUAITool
- Module and -Command like in Endpoints
-Scriptblock {} to have the code inside the aitools.ps1 file.
-Endpoint to use a endpoint instead of a script (Max wait time would need to be 60 or lower as a max)
-ArchiveJobAfterCompletion to automatically archive the script run job log after completion or retrival, currently it creates a mess in the jobs table.
New Cmdlet New-PSUAIToolResponse to add the "structured" element to the response via the mcp server.
The Idea is more or less the same as the New-PSUApiResponse cmdlet.
Currently the output looks like this:
{
"content": [
{
"type": "text",
"text": "Information - {\r\n \"GivenName\": \"XXXX\",\r\n \"Surname\": \"XXX\",\r\n \"UserPrincipalName\": \"XXXX@XXXXX.XX\",\r\n \"Enabled\": true,\r\n \"SamAccountName\": \"XXXXX\",\r\n \"SID\": {\r\n \"BinaryLength\": XX,\r\n \"AccountDomainSid\": \"MEH\",\r\n \"Value\": \"XXXXXXX\"\r\n },\r\n \"DistinguishedName\": \"Woo Hooo\",\r\n \"Name\": \"XXXXX\",\r\n \"ObjectClass\": \"user\",\r\n \"ObjectGuid\": \"GUID\",\r\n \"PropertyNames\": [\r\n \"DisplayName\",\r\n \"DistinguishedName\",\r\n \"Enabled\",\r\n \"GivenName\",\r\n \"mail\",\r\n \"Name\",\r\n \"ObjectClass\",\r\n \"ObjectGUID\",\r\n \"SamAccountName\",\r\n \"SID\",\r\n \"Surname\",\r\n \"UserPrincipalName\"\r\n ],\r\n \"AddedProperties\": [],\r\n \"RemovedProperties\": [],\r\n \"ModifiedProperties\": [],\r\n \"PropertyCount\": 12,\r\n \"DisplayName\": \"XXXXX XXXX\",\r\n \"mail\": \"XXXX@XXXX.XX\",\r\n \"ObjectGUID\": \"XXXXXXXX\"\r\n}"
}
]
}
It's fine, but being able to return a structured element inside the "content" object, would help, this would also drastically help with not needing to convert to json before returning the result.
A parameter to choose encoding could be nice, like formats like Markdown , XML , Json , Csv etc.